Changeset 42 for trunk/Base/Controller.php
- Timestamp:
- Nov 24, 2009, 9:13:38 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Base/Controller.php
r40 r42 1 1 <?php 2 3 include_once(dirname(__FILE__).'/Module.php'); 2 4 3 5 class Controller extends Module 4 6 { 7 function OnAccessDenied($Action, $Id) 8 { 9 return($this->System->Output->SystemMessage('Nemáte oprávnění provést akci "'.$Action.'" modulu "'.substr(get_class($this), 0, -10).'" na položce "'.$Id.'"')); 10 } 11 12 function Process() 13 { 14 if(array_key_exists('A', $_GET)) $Action = $_GET['A']; 15 else $Action = 'Show'; 16 if(method_exists($this, $Action)) 17 { 18 if(array_key_exists('Id', $_GET)) $Id = $_GET['Id']; 19 else $Id = ''; 20 if($this->System->Modules['Permission']->Check(substr(get_class($this), 0, -10), $Action, $Id)) 21 return($this->$Action()); 22 else return($this->OnAccessDenied($Action, $Id)); 23 } else return($this->System->Output->SystemMessage('Metoda "'.$Action.'" modulu "'.get_class($this).'" nenalezena.')); 24 } 25 26 function RequireParameter($Name) 27 { 28 //if(!array_key_exists($Name, $_GET)) return($this->System->SystemMessage('Přístup zamítnut.'); 29 } 5 30 } 6 31
Note:
See TracChangeset
for help on using the changeset viewer.