Changeset 873 for trunk/Modules/User
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- Location:
- trunk/Modules/User
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/User.php
r858 r873 122 122 /* 123 123 124 if ($this->InstalledVersion == '1.0') {124 if ($this->InstalledVersion == '1.0') { 125 125 $this->System->Database->Query('SELECT * FROM User WHERE Id=1'); 126 126 $this->InstalledVersion = '1.1'; … … 132 132 { 133 133 $this->System->User = new User($this->System); 134 if (isset($_SERVER['REMOTE_ADDR'])) $this->System->User->Check();134 if (isset($_SERVER['REMOTE_ADDR'])) $this->System->User->Check(); 135 135 $this->System->RegisterPage('userlist', 'PageUserList'); 136 136 $this->System->RegisterPage('user', 'PageUser'); … … 290 290 function TopBarCallback() 291 291 { 292 if ($this->System->User->User['Id'] == null)292 if ($this->System->User->User['Id'] == null) 293 293 { 294 294 $Output = '<a href="'.$this->System->Link('/user/?Action=LoginForm').'">Přihlášení</a> '. … … 301 301 // <a href="'.$this->System->Link('/?Action=UserOptions').'">Nastavení</a>'; 302 302 } 303 return ($Output);303 return ($Output); 304 304 } 305 305 } -
trunk/Modules/User/UserList.php
r833 r873 9 9 function Show() 10 10 { 11 if (!$this->System->User->CheckPermission('User', 'ShowList'))12 return ('Nemáte oprávnění');11 if (!$this->System->User->CheckPermission('User', 'ShowList')) 12 return ('Nemáte oprávnění'); 13 13 14 14 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `User`'); … … 30 30 31 31 $DbResult = $this->Database->query($Query); 32 while ($User = $DbResult->fetch_assoc())32 while ($User = $DbResult->fetch_assoc()) 33 33 { 34 34 $Devices = array(); 35 35 $DbResult2 = $this->Database->query('SELECT `Id` FROM `Member` WHERE `Member`.`ResponsibleUser` = '.$User['Id']); 36 while ($Member = $DbResult2->fetch_assoc())36 while ($Member = $DbResult2->fetch_assoc()) 37 37 { 38 38 $DbResult3 = $this->Database->query('SELECT `Name`, `Id` FROM `NetworkDevice` '. 39 39 'WHERE `Member` = '.$Member['Id'].' AND `Used`=1 ORDER BY `Name`'); 40 while ($Device = $DbResult3->fetch_assoc())40 while ($Device = $DbResult3->fetch_assoc()) 41 41 { 42 42 $Devices[] = $Device['Name']; … … 52 52 $Output .= $PageList['Output']; 53 53 54 return ($Output);54 return ($Output); 55 55 } 56 56 } -
trunk/Modules/User/UserModel.php
r828 r873 30 30 function Hash($Password, $Salt) 31 31 { 32 return (sha1(sha1($Password).$Salt));32 return (sha1(sha1($Password).$Salt)); 33 33 } 34 34 35 35 function Verify($Password, $Salt, $StoredHash) 36 36 { 37 return ($this->Hash($Password, $Salt) == $StoredHash);37 return ($this->Hash($Password, $Salt) == $StoredHash); 38 38 } 39 39 … … 71 71 // Lookup user record 72 72 $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"'); 73 if ($Query->num_rows > 0)73 if ($Query->num_rows > 0) 74 74 { 75 75 // Refresh time of last access … … 81 81 82 82 // Logged permanently? 83 if (array_key_exists('LoginHash', $_COOKIE))83 if (array_key_exists('LoginHash', $_COOKIE)) 84 84 { 85 85 $DbResult = $this->Database->query('SELECT * FROM `UserOnline` WHERE `User`='.$_COOKIE['LoginUserId']. 86 86 ' AND `StayLogged`=1 AND SessionId!="'.$SID.'"'); 87 if ($DbResult->num_rows > 0)87 if ($DbResult->num_rows > 0) 88 88 { 89 89 $DbRow = $DbResult->fetch_assoc(); 90 if (sha1($_COOKIE['LoginUserId'].$DbRow['StayLoggedHash']) == $_COOKIE['LoginHash'])90 if (sha1($_COOKIE['LoginUserId'].$DbRow['StayLoggedHash']) == $_COOKIE['LoginHash']) 91 91 { 92 92 $this->Database->query('DELETE FROM `UserOnline` WHERE `SessionId`="'.$SID.'"'); … … 99 99 $Query = $this->Database->select('UserOnline', '*', '`SessionId`="'.$SID.'"'); 100 100 $Row = $Query->fetch_assoc(); 101 if ($Row['User'] != '')101 if ($Row['User'] != '') 102 102 { 103 103 $Query = $this->Database->query('SELECT `User`.*, `UserCustomerRel`.`Customer` AS `Member` FROM `User` '. … … 114 114 // Remove nonactive users 115 115 $DbResult = $this->Database->select('UserOnline', '`Id`, `User`', '(`ActivityTime` < DATE_SUB(NOW(), INTERVAL '.$this->OnlineStateTimeout.' SECOND)) AND (`StayLogged` = 0)'); 116 while ($DbRow = $DbResult->fetch_array())116 while ($DbRow = $DbResult->fetch_array()) 117 117 { 118 118 $this->Database->delete('UserOnline', 'Id='.$DbRow['Id']); 119 if ($DbRow['User'] != null) $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Logout');119 if ($DbRow['User'] != null) $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Logout'); 120 120 } 121 121 //$this->LoadPermission($this->User['Role']); … … 127 127 function Register($Login, $Password, $Password2, $Email, $Name) 128 128 { 129 if (($Email == '') || ($Login == '') || ($Password == '') || ($Password2 == '') || ($Name == '')) $Result = DATA_MISSING;130 else if ($Password != $Password2) $Result = PASSWORDS_UNMATCHED;129 if (($Email == '') || ($Login == '') || ($Password == '') || ($Password2 == '') || ($Name == '')) $Result = DATA_MISSING; 130 else if ($Password != $Password2) $Result = PASSWORDS_UNMATCHED; 131 131 else 132 132 { 133 133 // Is user registred yet? 134 134 $Query = $this->Database->select('User', '*', 'Login = "'.$Login.'"'); 135 if ($Query->num_rows > 0) $Result = LOGIN_USED;135 if ($Query->num_rows > 0) $Result = LOGIN_USED; 136 136 else 137 137 { 138 138 $Query = $this->Database->select('User', '*', 'Name = "'.$Name.'"'); 139 if ($Query->num_rows > 0) $Result = NAME_USED;139 if ($Query->num_rows > 0) $Result = NAME_USED; 140 140 else 141 141 { 142 142 $Query = $this->Database->select('User', '*', 'Email = "'.$Email.'"'); 143 if ($Query->num_rows > 0) $Result = EMAIL_USED;143 if ($Query->num_rows > 0) $Result = EMAIL_USED; 144 144 else 145 145 { … … 177 177 } 178 178 } 179 return ($Result);179 return ($Result); 180 180 } 181 181 … … 183 183 { 184 184 $DbResult = $this->Database->select('User', 'Id, Login, Password', 'Id = '.$Id); 185 if ($DbResult->num_rows > 0)185 if ($DbResult->num_rows > 0) 186 186 { 187 187 $Row = $DbResult->fetch_array(); 188 188 $NewPassword = substr(sha1(strtoupper($Row['Login'])), 0, 7); 189 if ($Hash == $NewPassword)189 if ($Hash == $NewPassword) 190 190 { 191 191 $this->Database->update('User', 'Id='.$Row['Id'], array('Locked' => 0)); … … 195 195 } else $Output = PASSWORDS_UNMATCHED; 196 196 } else $Output = USER_NOT_FOUND; 197 return ($Output);197 return ($Output); 198 198 } 199 199 200 200 function Login($Login, $Password, $StayLogged = false) 201 201 { 202 if ($StayLogged) $StayLogged = 1; else $StayLogged = 0;202 if ($StayLogged) $StayLogged = 1; else $StayLogged = 0; 203 203 $SID = session_id(); 204 204 $Query = $this->Database->select('User', '*', 'Login="'.$Login.'"'); 205 if ($Query->num_rows > 0)205 if ($Query->num_rows > 0) 206 206 { 207 207 $Row = $Query->fetch_assoc(); 208 208 $PasswordHash = new PasswordHash(); 209 if (!$PasswordHash->Verify($Password, $Row['Salt'], $Row['Password'])) $Result = BAD_PASSWORD;210 else if ($Row['Locked'] == 1) $Result = ACCOUNT_LOCKED;209 if (!$PasswordHash->Verify($Password, $Row['Salt'], $Row['Password'])) $Result = BAD_PASSWORD; 210 else if ($Row['Locked'] == 1) $Result = ACCOUNT_LOCKED; 211 211 else 212 212 { … … 217 217 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array( 218 218 'User' => $Row['Id'], 'StayLogged' => $StayLogged, 'StayLoggedHash' => $StayLoggedSalt)); 219 if ($StayLogged)219 if ($StayLogged) 220 220 { 221 221 setcookie('LoginUserId', $Row['Id'], time()+365*24*60*60, $this->System->Link('/')); … … 231 231 } 232 232 } else $Result = USER_NOT_REGISTRED; 233 return ($Result);233 return ($Result); 234 234 } 235 235 … … 240 240 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'Logout', $this->User['Login']); 241 241 $this->Check(); 242 return (USER_LOGGED_OUT);242 return (USER_LOGGED_OUT); 243 243 } 244 244 … … 247 247 $this->Roles = array(); 248 248 $DbResult = $this->Database->select('UserRole', '*'); 249 while ($DbRow = $DbResult->fetch_array())249 while ($DbRow = $DbResult->fetch_array()) 250 250 $this->Roles[] = $DbRow; 251 251 } … … 255 255 $this->User['Permission'] = array(); 256 256 $DbResult = $this->Database->query('SELECT `UserRolePermission`.*, `PermissionOperation`.`Description` FROM `UserRolePermission` JOIN `PermissionOperation` ON `PermissionOperation`.`Id` = `UserRolePermission`.`Operation` WHERE `UserRolePermission`.`Role` = '.$Role); 257 if ($DbResult->num_rows > 0)258 while ($DbRow = $DbResult->fetch_array())257 if ($DbResult->num_rows > 0) 258 while ($DbRow = $DbResult->fetch_array()) 259 259 $this->User['Permission'][$DbRow['Operation']] = $DbRow; 260 260 } … … 264 264 $Result = array(); 265 265 $DbResult = $this->Database->query('SELECT `UserRolePermission`.*, `PermissionOperation`.`Description`, `UserRole`.`Title` FROM `UserRolePermission` LEFT JOIN `PermissionOperation` ON `PermissionOperation`.`Id` = `UserRolePermission`.`Operation` LEFT JOIN `UserRole` ON `UserRole`.`Id` = `UserRolePermission`.`Role`'); 266 while ($DbRow = $DbResult->fetch_array())266 while ($DbRow = $DbResult->fetch_array()) 267 267 { 268 268 $Value = ''; 269 if ($DbRow['Read']) $Value .= 'R';270 if ($DbRow['Write']) $Value .= 'W';269 if ($DbRow['Read']) $Value .= 'R'; 270 if ($DbRow['Write']) $Value .= 'W'; 271 271 $Result[$DbRow['Description']][$DbRow['Title']] = $Value; 272 272 } 273 return ($Result);273 return ($Result); 274 274 } 275 275 … … 278 278 $PermissionExists = false; 279 279 // First try to check cache group-group relation 280 if (array_key_exists($GroupId, $this->PermissionGroupCache))280 if (array_key_exists($GroupId, $this->PermissionGroupCache)) 281 281 { 282 282 $PermissionExists = true; … … 287 287 '") AND (`AssignedGroup` IS NOT NULL)'); 288 288 $DbRow = array(); 289 while ($DbRow[] = $DbResult->fetch_array());289 while ($DbRow[] = $DbResult->fetch_array()); 290 290 $this->PermissionGroupCache[$GroupId] = $DbRow; 291 291 $PermissionExists = true; 292 292 } 293 if ($PermissionExists)294 { 295 foreach ($this->PermissionGroupCache[$GroupId] as $DbRow)296 { 297 if ($DbRow['AssignedGroup'] != '')298 if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return(true);293 if ($PermissionExists) 294 { 295 foreach ($this->PermissionGroupCache[$GroupId] as $DbRow) 296 { 297 if ($DbRow['AssignedGroup'] != '') 298 if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return (true); 299 299 } 300 300 } 301 301 302 302 // Check group-operation relation 303 if (array_key_exists($GroupId.','.$OperationId, $this->PermissionGroupCacheOp))303 if (array_key_exists($GroupId.','.$OperationId, $this->PermissionGroupCacheOp)) 304 304 { 305 305 $PermissionExists = true; … … 308 308 // If no permission combination exists in cache, do new check of database items 309 309 $DbResult = $this->Database->select('PermissionGroupAssignment', '*', '`Group`="'.$GroupId.'" AND `AssignedOperation`="'.$OperationId.'"'); 310 if ($DbResult->num_rows > 0) $this->PermissionGroupCacheOp[$GroupId.','.$OperationId] = true;310 if ($DbResult->num_rows > 0) $this->PermissionGroupCacheOp[$GroupId.','.$OperationId] = true; 311 311 else $this->PermissionGroupCacheOp[$GroupId.','.$OperationId] = false; 312 312 $PermissionExists = true; 313 313 } 314 if ($PermissionExists)315 { 316 return ($this->PermissionGroupCacheOp[$GroupId.','.$OperationId]);317 } 318 return (false);314 if ($PermissionExists) 315 { 316 return ($this->PermissionGroupCacheOp[$GroupId.','.$OperationId]); 317 } 318 return (false); 319 319 } 320 320 … … 323 323 // Get module id 324 324 $DbResult = $this->Database->select('Module', 'Id', '`Name`="'.$Module.'"'); 325 if ($DbResult->num_rows > 0)325 if ($DbResult->num_rows > 0) 326 326 { 327 327 $DbRow = $DbResult->fetch_assoc(); 328 328 $ModuleId = $DbRow['Id']; 329 } else return (false);329 } else return (false); 330 330 331 331 // First try to check cache 332 if (in_array(array($Module, $Operation, $ItemType, $ItemType), $this->PermissionCache))332 if (in_array(array($Module, $Operation, $ItemType, $ItemType), $this->PermissionCache)) 333 333 { 334 334 $OperationId = array_search(array($Module, $Operation, $ItemType, $ItemIndex), $this->PermissionCache); … … 339 339 $DbResult = $this->Database->select('PermissionOperation', 'Id', '(`Module`="'.$ModuleId. 340 340 '") AND (`Item`="'.$ItemType.'") AND (`ItemId`='.$ItemIndex.') AND (`Operation`="'.$Operation.'")'); 341 if ($DbResult->num_rows > 0)341 if ($DbResult->num_rows > 0) 342 342 { 343 343 $DbRow = $DbResult->fetch_array(); … … 352 352 } 353 353 354 if ($PermissionExists)355 { 356 if ($this->User['Id'] == null) $UserCondition = '(`User` IS NULL)';354 if ($PermissionExists) 355 { 356 if ($this->User['Id'] == null) $UserCondition = '(`User` IS NULL)'; 357 357 else $UserCondition = '(`User`="'.$this->User['Id'].'")'; 358 358 // Check user-operation relation 359 359 $DbResult = $this->Database->select('PermissionUserAssignment', '*', $UserCondition.' AND (`AssignedOperation`="'.$OperationId.'")'); 360 if ($DbResult->num_rows > 0) return(true);360 if ($DbResult->num_rows > 0) return (true); 361 361 362 362 // Check user-group relation 363 363 $DbResult = $this->Database->select('PermissionUserAssignment', 'AssignedGroup', $UserCondition); 364 while ($DbRow = $DbResult->fetch_array())365 { 366 if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return(true);367 } 368 return (false);369 } else return (false);364 while ($DbRow = $DbResult->fetch_array()) 365 { 366 if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return (true); 367 } 368 return (false); 369 } else return (false); 370 370 } 371 371 … … 373 373 { 374 374 $DbResult = $this->Database->select('User', 'Login, Name, Id, Email, Password', '`Login`="'.$Login.'" AND `Email`="'.$Email.'"'); 375 if ($DbResult->num_rows > 0)375 if ($DbResult->num_rows > 0) 376 376 { 377 377 $Row = $DbResult->fetch_array(); … … 394 394 $this->System->ModuleManager->Modules['Log']->NewRecord('User', 'PasswordRecoveryRequest', 'Login='.$Login.',Email='.$Email); 395 395 } else $Output = USER_PASSWORD_RECOVERY_FAIL; 396 return ($Output);396 return ($Output); 397 397 } 398 398 … … 400 400 { 401 401 $DbResult = $this->Database->select('User', 'Id, Login, Password', 'Id = '.$Id); 402 if ($DbResult->num_rows > 0)402 if ($DbResult->num_rows > 0) 403 403 { 404 404 $Row = $DbResult->fetch_array(); 405 405 $NewPassword2 = substr(sha1(strtoupper($Row['Login'])), 0, 7); 406 if (($NewPassword == $NewPassword2) and ($Hash == $Row['Password']))406 if (($NewPassword == $NewPassword2) and ($Hash == $Row['Password'])) 407 407 { 408 408 $PasswordHash = new PasswordHash(); … … 414 414 } else $Output = PASSWORDS_UNMATCHED; 415 415 } else $Output = USER_NOT_FOUND; 416 return ($Output);416 return ($Output); 417 417 } 418 418 … … 420 420 { 421 421 $DbResult = $this->Database->select('APIToken', 'User', '`Token`="'.$Token.'"'); 422 if ($DbResult->num_rows > 0)422 if ($DbResult->num_rows > 0) 423 423 { 424 424 $DbRow = $DbResult->fetch_assoc(); 425 425 $User = new User($this->System); 426 426 $User->User = array('Id' => $DbRow['User']); 427 return ($User->CheckPermission($Module, $Operation));428 } else return (false);427 return ($User->CheckPermission($Module, $Operation)); 428 } else return (false); 429 429 } 430 430 } -
trunk/Modules/User/UserPage.php
r828 r873 9 9 function Panel($Title, $Content, $Menu = array()) 10 10 { 11 if (count($Menu) > 0)12 foreach ($Menu as $Item)11 if (count($Menu) > 0) 12 foreach ($Menu as $Item) 13 13 $Title .= '<div class="Action">'.$Item.'</div>'; 14 return ('<div class="Panel"><div class="Title">'.$Title.'</div><div class="Content">'.$Content.'</div></div>');14 return ('<div class="Panel"><div class="Title">'.$Title.'</div><div class="Content">'.$Content.'</div></div>'); 15 15 } 16 16 … … 39 39 40 40 $DbResult = $this->Database->query($Query); 41 while ($Contact = $DbResult->fetch_assoc())41 while ($Contact = $DbResult->fetch_assoc()) 42 42 { 43 43 $Output .= '<tr>'. … … 50 50 $Output .= $PageList['Output']; 51 51 52 return ($Output);52 return ($Output); 53 53 } 54 54 … … 56 56 { 57 57 $Output = ''; 58 if ($this->System->User->User['Id'] != null)58 if ($this->System->User->User['Id'] != null) 59 59 { 60 60 $Actions = ''; 61 foreach ($this->System->ModuleManager->Modules['User']->UserPanel as $Action)62 { 63 if (is_string($Action[0]))61 foreach ($this->System->ModuleManager->Modules['User']->UserPanel as $Action) 62 { 63 if (is_string($Action[0])) 64 64 { 65 65 $Class = new $Action[0]($this->System); … … 71 71 $Output .= $this->Panel('Nabídka uživatele', $Actions); 72 72 $Output .= '</td><td style="vertical-align:top;">'; 73 if ($this->System->User->User['Id'] != null)73 if ($this->System->User->User['Id'] != null) 74 74 { 75 75 $Form = new Form($this->System->FormManager); … … 85 85 $Output .= '</td></tr></table></div>'; 86 86 } else $Output .= $this->SystemMessage('Oprávnění', 'Nejste přihlášen'); 87 return ($Output);87 return ($Output); 88 88 } 89 89 … … 91 91 { 92 92 $Output = ''; 93 if (array_key_exists('Action', $_GET))93 if (array_key_exists('Action', $_GET)) 94 94 { 95 95 $Action = $_GET['Action']; 96 if ($Action == 'LoginForm')96 if ($Action == 'LoginForm') 97 97 { 98 98 $Form = new Form($this->System->FormManager); … … 103 103 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 104 104 } else 105 if ($Action == 'Login')106 { 107 if (array_key_exists('Username', $_POST) and array_key_exists('Password', $_POST))105 if ($Action == 'Login') 106 { 107 if (array_key_exists('Username', $_POST) and array_key_exists('Password', $_POST)) 108 108 { 109 109 $Form = new Form($this->System->FormManager); 110 110 $Form->SetClass('UserLogin'); 111 111 $Form->OnSubmit = '?Action=Login'; 112 if (array_key_exists('StayLogged', $_POST) and ($_POST['StayLogged'] == 'on')) $StayLogged = true;112 if (array_key_exists('StayLogged', $_POST) and ($_POST['StayLogged'] == 'on')) $StayLogged = true; 113 113 else $StayLogged = false; 114 114 $Result = $this->System->User->Login($_POST['Username'], $_POST['Password'], $StayLogged); 115 115 $Output .= $this->SystemMessage('Přihlášení', $Result); 116 if ($Result <> USER_LOGGED_IN)116 if ($Result <> USER_LOGGED_IN) 117 117 { 118 118 $Form->LoadValuesFromForm(); … … 128 128 } else $Output .= $this->SystemMessage('Přihlášení', 'Nezadány přihlašovací údaje'); 129 129 } else 130 if ($Action == 'Logout')131 { 132 if ($this->System->User->User['Id'] != null)130 if ($Action == 'Logout') 131 { 132 if ($this->System->User->User['Id'] != null) 133 133 { 134 134 $Output .= $this->SystemMessage('Odhlášení', $this->System->User->Logout()); 135 135 } else $Output .= $this->SystemMessage('Nastavení uživatele', 'Nejste přihlášen'); 136 136 } else 137 if ($Action == 'UserOptions')138 { 139 if ($this->System->User->User['Id'] != null)137 if ($Action == 'UserOptions') 138 { 139 if ($this->System->User->User['Id'] != null) 140 140 { 141 141 $Form = new Form($this->System->FormManager); … … 146 146 } else $Output .= $this->SystemMessage('Nastavení uživatele', 'Nejste přihlášen'); 147 147 } else 148 if ($Action == 'UserOptionsSave')148 if ($Action == 'UserOptionsSave') 149 149 { 150 150 $Form = new Form($this->System->FormManager); … … 158 158 $Output .= $Form->ShowEditForm(); 159 159 } else 160 if ($Action == 'UserRegister')160 if ($Action == 'UserRegister') 161 161 { 162 162 $Form = new Form($this->System->FormManager); … … 166 166 $Output .= $Form->ShowEditForm(); 167 167 } else 168 if ($Action == 'UserRegisterConfirm')168 if ($Action == 'UserRegisterConfirm') 169 169 { 170 170 $Output .= $this->SystemMessage('Potvrzení registrace', 171 171 $this->System->User->RegisterConfirm($_GET['User'], $_GET['H'])); 172 172 } else 173 if ($Action == 'PasswordRecovery')173 if ($Action == 'PasswordRecovery') 174 174 { 175 175 $Form = new Form($this->System->FormManager); … … 178 178 $Output .= $Form->ShowEditForm(); 179 179 } else 180 if ($Action == 'PasswordRecovery2')180 if ($Action == 'PasswordRecovery2') 181 181 { 182 182 $Form = new Form($this->System->FormManager); … … 185 185 $Result = $this->System->User->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']); 186 186 $Output .= $this->SystemMessage('Obnova hesla', $Result); 187 if ($Result <> USER_PASSWORD_RECOVERY_SUCCESS)187 if ($Result <> USER_PASSWORD_RECOVERY_SUCCESS) 188 188 { 189 189 $Output .= $Form->ShowEditForm(); 190 190 } 191 191 } else 192 if ($Action == 'PasswordRecoveryConfirm')192 if ($Action == 'PasswordRecoveryConfirm') 193 193 { 194 194 $Output .= $this->SystemMessage('Obnova hesla', $this->System->User->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P'])); 195 195 } else 196 if ($Action == 'UserRegisterSave')196 if ($Action == 'UserRegisterSave') 197 197 { 198 198 $Form = new Form($this->System->FormManager); … … 202 202 $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']); 203 203 $Output .= $this->SystemMessage('Registrace nového účtu', $Result); 204 if ($Result <> USER_REGISTRATED)204 if ($Result <> USER_REGISTRATED) 205 205 { 206 206 $Form->OnSubmit = '?Action=UserRegisterSave'; … … 208 208 } 209 209 } else 210 if ($Action == 'UserMenu')210 if ($Action == 'UserMenu') 211 211 { 212 212 $Output = $this->ShowUserPanel(); 213 213 } else $Output = $this->ShowMain(); 214 214 } else $Output = $this->ShowMain(); 215 return ($Output);215 return ($Output); 216 216 } 217 217 … … 219 219 { 220 220 $Output = 'Nebyla vybrána akce'; 221 return ($Output);221 return ($Output); 222 222 } 223 223 }
Note:
See TracChangeset
for help on using the changeset viewer.