Changeset 874 for trunk/Modules/User/UserModel.php
- Timestamp:
- Apr 6, 2020, 11:56:19 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/UserModel.php
r873 r874 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 … … 177 177 } 178 178 } 179 return ($Result);179 return $Result; 180 180 } 181 181 … … 195 195 } else $Output = PASSWORDS_UNMATCHED; 196 196 } else $Output = USER_NOT_FOUND; 197 return ($Output);197 return $Output; 198 198 } 199 199 … … 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 … … 271 271 $Result[$DbRow['Description']][$DbRow['Title']] = $Value; 272 272 } 273 return ($Result);273 return $Result; 274 274 } 275 275 … … 296 296 { 297 297 if ($DbRow['AssignedGroup'] != '') 298 if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return (true);298 if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return true; 299 299 } 300 300 } … … 314 314 if ($PermissionExists) 315 315 { 316 return ($this->PermissionGroupCacheOp[$GroupId.','.$OperationId]);317 } 318 return (false);316 return $this->PermissionGroupCacheOp[$GroupId.','.$OperationId]; 317 } 318 return false; 319 319 } 320 320 … … 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 … … 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 … … 364 364 while ($DbRow = $DbResult->fetch_array()) 365 365 { 366 if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return (true);367 } 368 return (false);369 } else return (false);366 if ($this->CheckGroupPermission($DbRow['AssignedGroup'], $OperationId) == true) return true; 367 } 368 return false; 369 } else return false; 370 370 } 371 371 … … 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 … … 414 414 } else $Output = PASSWORDS_UNMATCHED; 415 415 } else $Output = USER_NOT_FOUND; 416 return ($Output);416 return $Output; 417 417 } 418 418 … … 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 }
Note:
See TracChangeset
for help on using the changeset viewer.