Changeset 668 for trunk/Modules/User/User.php
- Timestamp:
- Jul 15, 2014, 9:48:54 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/User.php
r662 r668 285 285 { 286 286 // If no permission combination exists in cache, do new check of database items 287 $DbResult = $this->Database->select('PermissionGroupAssignment', '*', '`Group`="'.$GroupId.'" AND `AssignedGroup` IS NOT NULL'); 287 $DbResult = $this->Database->select('PermissionGroupAssignment', '*', '(`Group`="'.$GroupId. 288 '") AND (`AssignedGroup` IS NOT NULL)'); 288 289 $DbRow = array(); 289 290 while($DbRow[] = $DbResult->fetch_array()); 290 $this->PermissionGroupCache[$GroupId] = $DbRow;291 $this->PermissionGroupCache[$GroupId] = $DbRow; 291 292 $PermissionExists = true; 292 293 } … … 337 338 { 338 339 // If no permission combination exists in cache, do new check of database items 339 $DbResult = $this->Database->select('PermissionOperation', 'Id', '`Module`="'.$ModuleId.'" AND `Item`="'.$ItemType.'" AND `ItemId`='.$ItemIndex.' AND `Operation`="'.$Operation.'"'); 340 $DbResult = $this->Database->select('PermissionOperation', 'Id', '(`Module`="'.$ModuleId. 341 '") AND (`Item`="'.$ItemType.'") AND (`ItemId`='.$ItemIndex.') AND (`Operation`="'.$Operation.'")'); 340 342 if($DbResult->num_rows > 0) 341 343 { … … 414 416 } else $Output = USER_NOT_FOUND; 415 417 return($Output); 418 } 419 420 function CheckToken($Module, $Operation, $Token) 421 { 422 $DbResult = $this->Database->select('APIToken', 'User', '`Token`="'.$Token.'"'); 423 if($DbResult->num_rows > 0) 424 { 425 $DbRow = $DbResult->fetch_assoc(); 426 $User = new User($this->System); 427 $User->User = array('Id' => $DbRow['User']); 428 return($User->CheckPermission($Module, $Operation)); 429 } else return(false); 416 430 } 417 431 } … … 583 597 ), 584 598 )); 599 $this->System->FormManager->RegisterClass('APIToken', array( 600 'Title' => 'Přístupový token', 601 'Table' => 'APIToken', 602 'Items' => array( 603 'User' => array('Type' => 'TUser', 'Caption' => 'Uživatel', 'Default' => ''), 604 'Token' => array('Type' => 'String', 'Caption' => 'Token', 'Default' => ''), 605 ), 606 )); 585 607 $this->System->FormManager->RegisterClass('User', array( 586 608 'Title' => 'Uživatelé',
Note:
See TracChangeset
for help on using the changeset viewer.