Changeset 515 for trunk/Common/User.php
- Timestamp:
- Apr 8, 2013, 11:15:52 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/User.php
r493 r515 113 113 else 114 114 { 115 // Je uživatel registrován?115 // Is user registred yet? 116 116 $Query = $this->Database->select('User', '*', 'Login = "'.$Login.'"'); 117 117 if($Query->num_rows > 0) $Result = LOGIN_USED; … … 138 138 $NewPassword = substr(sha1(strtoupper($Login)), 0, 7); 139 139 140 // Send activation mail to user email 140 141 $Mail = new Mail(); 141 142 $Mail->Subject = 'Registrace nového účtu'; … … 194 195 $this->Database->update('User', 'Id='.$Row['Id'], array('LastLoginTime' => 'NOW()', 'LastIpAddress' => GetRemoteAddress())); 195 196 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => $Row['Id'])); 196 // načtení stavu stromu197 197 198 $Result = USER_LOGGED_IN; 198 199 $this->Check(); … … 289 290 function CheckPermission($Module, $Operation, $ItemType = '', $ItemIndex = 0) 290 291 { 291 //echo('Check '.$Module.' '.$Operation.' '.$ItemType.' '.$ItemIndex);292 //293 292 // First try to check cache 294 293 if(in_array(array($Module, $Operation, $ItemType, $ItemType), $this->PermissionCache)) … … 315 314 if($PermissionExists) 316 315 { 316 if($this->User['Id'] == null) $UserCondition = '(`User` IS NULL)'; 317 else $UserCondition = '(`User`="'.$this->User['Id'].'")'; 317 318 // Check user-operation relation 318 $DbResult = $this->Database->select('PermissionUserAssignment', '*', '`User`="'.$this->User['Id'].'" AND `AssignedOperation`="'.$OperationId.'"');319 $DbResult = $this->Database->select('PermissionUserAssignment', '*', $UserCondition.' AND (`AssignedOperation`="'.$OperationId.'")'); 319 320 if($DbResult->num_rows > 0) return(true); 320 321 321 322 // Check user-group relation 322 $DbResult = $this->Database->select('PermissionUserAssignment', 'AssignedGroup', '`User`="'.$this->User['Id'].'"');323 $DbResult = $this->Database->select('PermissionUserAssignment', 'AssignedGroup', $UserCondition); 323 324 while($DbRow = $DbResult->fetch_array()) 324 325 {
Note:
See TracChangeset
for help on using the changeset viewer.