Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | include_once(dirname(__FILE__).'/Module.php');
|
---|
4 |
|
---|
5 | class Controller extends Module
|
---|
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 | }
|
---|
30 | }
|
---|
31 |
|
---|
32 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.