Changeset 584 for trunk/Modules
- Timestamp:
- Oct 31, 2013, 4:57:11 PM (12 years ago)
- Location:
- trunk/Modules
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/IS/IS.php
r581 r584 75 75 { 76 76 $Output = ''; 77 if(!$this->System->User->CheckPermission($Table, 'Write')) 78 return('Nemáte oprávnění'); 77 79 if(array_key_exists('o', $_GET)) 78 80 { … … 123 125 { 124 126 $Output = ''; 127 if(!$this->System->User->CheckPermission($Table, 'Write')) 128 return('Nemáte oprávnění'); 125 129 $this->Database->delete($Table, 'Id='.$Id); 126 130 $Output .= $this->SystemMessage('Odstranění položky', 'Položka odstraněna'); … … 132 136 { 133 137 $Output = ''; 138 if(!$this->System->User->CheckPermission($Table, 'Write')) 139 return('Nemáte oprávnění'); 134 140 if(array_key_exists('o', $_GET)) 135 141 { … … 182 188 if($Table != '') $FormClass = $this->System->FormManager->Classes[$Table]; 183 189 else return($this->SystemMessage('Chyba', 'Tabulka nenalezena')); 190 if(!$this->System->User->CheckPermission($Table, 'Read')) 191 return('Nemáte oprávnění'); 184 192 185 193 $Form = new Form($this->System->FormManager); … … 383 391 function ShowSelect($Table, $Filter = '', $Title = '') 384 392 { 393 if(!$this->System->User->CheckPermission($Table, 'Read')) 394 return('Nemáte oprávnění'); 385 395 $this->BasicHTML = true; 386 396 $this->HideMenu = true; … … 394 404 function ShowMapSelect($Table, $Filter = '', $Title = '') 395 405 { 406 if(!$this->System->User->CheckPermission($Table, 'Write')) 407 return('Nemáte oprávnění'); 396 408 $MapApi = new MapApiGoogle($this->System); 397 409 $MapApi->Position = array('Lat' => $this->System->Config['Map']['DefaultLatitude'], … … 407 419 function ShowList($Table, $Filter = '', $Title = '', $ExcludeColumn = '') 408 420 { 421 if(!$this->System->User->CheckPermission($Table, 'Read')) 422 return('Nemáte oprávnění'); 409 423 $RowActions = '<a href="?a=view&t='.$Table.'&i=#RowId"><img alt="Ukázat" title="Ukázat" src="'. 410 424 $this->System->Link('/images/view.png').'"/></a>'. … … 521 535 'Items' => array('Type' => 'TMenuItemListMenu', 'Caption' => 'Položky'), 522 536 ), 523 )); 524 537 )); 525 538 } 526 539 -
trunk/Modules/NetworkConfigLinux/Generators/DNS.php
r569 r584 117 117 'Host' => array(), 118 118 'Alias' => array(), 119 'Network' => array('10.145.64', '10.145.65', '10.145.66', '10.145.67', '10.145.68', '10.145.69', '10.145.70', '10.145.71', '77.92.221', '172.16.0', '172.16.1'), 119 'Network' => array('10.145.64', '10.145.65', '10.145.66', '10.145.67', 120 '10.145.68', '10.145.69', '10.145.70', '10.145.71', '77.92.221', '172.16.0', 121 '172.16.1'), 120 122 ); 121 123 -
trunk/Modules/NetworkShare/SharePage.php
r548 r584 68 68 function Show() 69 69 { 70 if(!$this->System->User->CheckPermission(' Share', 'Display')) return('Nemáte oprávnění');70 if(!$this->System->User->CheckPermission('NetworkShare', 'Display')) return('Nemáte oprávnění'); 71 71 72 72 // If not only online checkbox checked -
trunk/Modules/OpeningHours/OpeningHours.php
r548 r584 36 36 function EditSubject($Id) 37 37 { 38 if($this->System->User->CheckPermission(' SubjectOpenTime', 'Edit'))38 if($this->System->User->CheckPermission('OpeningHours', 'Edit')) 39 39 { 40 40 $Output = '<div class="Centred">'; … … 78 78 79 79 $Output = ''; 80 if($this->System->User->CheckPermission(' SubjectOpenTime', 'Edit'))80 if($this->System->User->CheckPermission('OpeningHours', 'Edit')) 81 81 { 82 82 $this->Database->delete('SubjectOpenTimeDay', 'Subject='.$Id); -
trunk/Modules/Portal/Portal.php
r581 r584 105 105 { 106 106 $Output = ''; 107 $DbResult = $this->Database->query('SELECT *, `ActionIcon`.`Name` AS `Icon` FROM `Action` LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '. 107 $DbResult = $this->Database->query('SELECT *, `ActionIcon`.`Name` AS `Icon` FROM `Action` '. 108 'LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '. 108 109 'WHERE (`Group`='.$ActionGroup['Id'].') AND (`Enable` = 1)'); 109 110 while($Action = $DbResult->fetch_assoc()) … … 111 112 if($Action['Icon'] == '') $Action['Icon'] = 'clear.png'; 112 113 if(substr($Action['URL'], 0, 4) != 'http') $Action['URL'] = $this->System->Link($Action['URL']); 113 if(($Action['PermissionModule'] == '') or (($Action['PermissionModule'] != '') and $this->System->User->User->CheckPermission($Action['PermissionModule'], $Action['PermissionOperation']))) 114 $Output .= '<img alt="'.$Action['Title'].'" src="images/favicons/'.$Action['Icon'].'" width="16" height="16" /> <a href="'.$Action['URL'].'">'.$Action['Title'].'</a><br />'; 114 if($Action['PermissionOperation'] != '') 115 { 116 $DbResult2 = $this->Database->query('SELECT * FROM PermissionOperation'. 117 ' LEFT JOIN Module ON Module.Id=PermissionOperation.Module'. 118 ' WHERE Id='.$Action['PermissionOperation']); 119 $DbRow2 = $DbResult2->fetch_assoc(); 120 if($this->System->User->User->CheckPermission($DbRow2['Module'], $DbRow2['Operation'])) 121 $Allowed = true; else $Allowed = false; 122 } else $Allowed = true; 123 if($Allowed) 124 $Output .= '<img alt="'.$Action['Title'].'" src="images/favicons/'.$Action['Icon'].'" width="16" height="16" /> <a href="'.$Action['URL'].'">'.$Action['Title'].'</a><br />'; 115 125 } 116 126 return($this->Panel($ActionGroup['Name'], $Output)); -
trunk/Modules/User/User.php
r565 r584 290 290 function CheckPermission($Module, $Operation, $ItemType = '', $ItemIndex = 0) 291 291 { 292 // Get module id 293 $DbResult = $this->Database->select('Module', 'Id', '`Name`="'.$Module.'"'); 294 if($DbResult->num_rows > 0) 295 { 296 $DbRow = $DbResult->fetch_assoc(); 297 $ModuleId = $DbRow['Id']; 298 } else return(false); 299 292 300 // First try to check cache 293 301 if(in_array(array($Module, $Operation, $ItemType, $ItemType), $this->PermissionCache)) … … 298 306 { 299 307 // If no permission combination exists in cache, do new check of database items 300 $DbResult = $this->Database->select('PermissionOperation', 'Id', '`Module`="'.$Module .'" AND `Item`="'.$ItemType.'" AND `ItemId`='.$ItemIndex.' AND `Operation`="'.$Operation.'"');308 $DbResult = $this->Database->select('PermissionOperation', 'Id', '`Module`="'.$ModuleId.'" AND `Item`="'.$ItemType.'" AND `ItemId`='.$ItemIndex.' AND `Operation`="'.$Operation.'"'); 301 309 if($DbResult->num_rows > 0) 302 310 { … … 456 464 'Table' => 'PermissionOperation', 457 465 'Items' => array( 458 'Module' => array('Type' => ' String', 'Caption' => 'Modul', 'Default' => ''),466 'Module' => array('Type' => 'TModule', 'Caption' => 'Modul', 'Default' => ''), 459 467 'Operation' => array('Type' => 'String', 'Caption' => 'Operace', 'Default' => ''), 460 468 'Item' => array('Type' => 'String', 'Caption' => 'Položka', 'Default' => ''),
Note:
See TracChangeset
for help on using the changeset viewer.