Ignore:
Timestamp:
Nov 24, 2009, 9:13:38 AM (14 years ago)
Author:
george
Message:
  • Upraveno: Přepracován základový webový systém
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Base/Controller.php

    r40 r42  
    11<?php
     2
     3include_once(dirname(__FILE__).'/Module.php');
    24
    35class Controller extends Module
    46{
     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  }
    530}
    631
Note: See TracChangeset for help on using the changeset viewer.