Changeset 584
- Timestamp:
- Oct 31, 2013, 4:57:11 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Version.php
r583 r584 1 1 <?php 2 2 3 $Revision = 58 2; // Subversion revision4 $DatabaseRevision = 5 74; // SQL structure revision5 $ReleaseTime = '2013-10- 19';3 $Revision = 584; // Subversion revision 4 $DatabaseRevision = 544; // SQL structure revision 5 $ReleaseTime = '2013-10-31'; -
trunk/FormClasses.php
r568 r584 19 19 { 20 20 $FormManager->Classes = array( 21 'Module' => array( 22 'Title' => 'Moduly', 23 'Table' => 'Module', 24 'Items' => array( 25 'Name' => array('Type' => 'String', 'Caption' => 'Systémové jméno', 'Default' => ''), 26 'Title' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 27 ), 28 ), 21 29 'Action' => array( 22 30 'Title' => 'Akce', … … 239 247 'Filter' => '1', 240 248 ), 249 'TModule' => array( 250 'Type' => 'Reference', 251 'Table' => 'Module', 252 'Id' => 'Id', 253 'Name' => 'Name', 254 'Filter' => '1', 255 ), 241 256 'TMapPosition' => array( 242 257 'Type' => 'Reference', -
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' => ''), -
trunk/admin/Updates.php
r574 r584 383 383 } 384 384 385 function UpdateTo584($Manager) 386 { 387 $Manager->Execute("CREATE TABLE IF NOT EXISTS `Module` ( 388 `Id` int(11) NOT NULL AUTO_INCREMENT, 389 `Name` varchar(255) NOT NULL, 390 `Title` varchar(255) NOT NULL, 391 PRIMARY KEY (`Id`) 392 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=33 ;"); 393 394 $Manager->Execute("INSERT INTO `Module` (`Id`, `Name`, `Title`) VALUES 395 (1, 'Customer', 'Zákazník'), 396 (2, 'EmailQueue', 'Fronta emailů'), 397 (3, 'Error', 'Obsluha chyb'), 398 (4, 'File', 'Správa souborů'), 399 (5, 'Finance', 'Finance'), 400 (6, 'FinanceBankAPI', 'Rozhraní pro bankovní účty'), 401 (7, 'Chat', 'Pokec'), 402 (8, 'IS', 'Informační systém'), 403 (9, 'Log', 'Záznam událostí'), 404 (10, 'Map', 'Mapa'), 405 (11, 'Meals', 'Jídelníček'), 406 (12, 'Meteostation', 'Meteostanice'), 407 (13, 'Network', 'Síť'), 408 (14, 'NetworkConfig', 'Nastavení sítě'), 409 (15, 'NetworkConfigLinux', 'Nastavení linuxových zařízení'), 410 (16, 'NetworkConfigRouterOS', 'Nastavení RouterOS zařízení'), 411 (17, 'NetworkShare', 'Síťové sdílení'), 412 (18, 'NetworkTopology', 'Síťová topologie'), 413 (19, 'News', 'Aktuality'), 414 (20, 'OpeningHours', 'Otvírací doby'), 415 (21, 'Portal', 'Portál'), 416 (22, 'Search', 'Vyhledávání'), 417 (23, 'Setup', 'Instalace systému'), 418 (24, 'SpeedTest', 'Měření rychlosti'), 419 (25, 'Stock', 'Sklad'), 420 (26, 'System', 'Systém'), 421 (27, 'Task', 'Úlohy'), 422 (28, 'TimeMeasure', 'Časové průběhy'), 423 (29, 'TV', 'Televize'), 424 (30, 'User', 'Uživatelé'), 425 (31, 'WebCam', 'Web kamery'), 426 (32, 'Wiki', 'Wiki');"); 427 $Manager->Execute("UPDATE `PermissionOperation` SET `Module` = 'Meals' WHERE `PermissionOperation`.`Module` ='EatingPlace';"); 428 $Manager->Execute("UPDATE `PermissionOperation` SET `Module` = 'NetworkShare' WHERE `PermissionOperation`.`Module` ='Share';"); 429 $Manager->Execute("UPDATE `PermissionOperation` SET `Module` = 'SubjectOpenTime' WHERE `PermissionOperation`.`Module` ='OpeningHours';"); 430 $Manager->Execute("UPDATE `PermissionOperation` SET `Module`=(SELECT `Id` FROM `Module` WHERE `Module`.`Name` = `PermissionOperation`.`Module`)"); 431 $Manager->Execute("ALTER TABLE `PermissionOperation` CHANGE `Module` `Module` INT( 11 ) NOT NULL ;"); 432 $Manager->Execute("ALTER TABLE `PermissionOperation` ADD FOREIGN KEY ( `Module` ) REFERENCES `Module` ( 433 `Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;"); 434 $Manager->Execute("UPDATE `Action` SET `Action`.`PermissionOperation` =(SELECT Id FROM `PermissionOperation` WHERE `PermissionOperation`.`Operation`=`Action`.`PermissionOperation` AND `PermissionOperation`.`Module` = (SELECT Id FROM `Module` WHERE `Module`.`Name`=`Action`.`PermissionModule`))"); 435 $Manager->Execute("ALTER TABLE `Action` CHANGE `PermissionOperation` `PermissionOperation` INT( 11 ) NULL ;"); 436 $Manager->Execute("ALTER TABLE `Action` DROP `PermissionModule` ;"); 437 $Manager->Execute("UPDATE `Action` SET `PermissionOperation`=NULL WHERE `PermissionOperation`=0"); 438 $Manager->Execute("ALTER TABLE `Action` ADD INDEX (`PermissionOperation`);"); 439 $Manager->Execute("ALTER TABLE `Action` ADD FOREIGN KEY ( `PermissionOperation` ) REFERENCES `PermissionOperation` ( 440 `Id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;"); 441 } 442 443 385 444 $Updates = array( 386 445 491 => array('Revision' => 493, 'Function' => 'UpdateTo493'), … … 405 464 565 => array('Revision' => 571, 'Function' => 'UpdateTo571'), 406 465 571 => array('Revision' => 574, 'Function' => 'UpdateTo574'), 466 574 => array('Revision' => 584, 'Function' => 'UpdateTo584'), 407 467 );
Note:
See TracChangeset
for help on using the changeset viewer.