示例#1
0
文件: Account.php 项目: maxwroc/PHP
 public function init()
 {
     parent::init();
     if (!$this->oAuth->isLoggedIn()) {
         $this->redirect('/');
         echo ' ';
         return;
     }
     // sprawdzamy czy moze uzywac kontrolera
     if (!in_array($this->oCurrentUser->get('role_id')->name, $this->aRolesAllowed)) {
         $this->redirect('/');
         echo ' ';
     }
 }
示例#2
0
文件: Service.php 项目: maxwroc/PHP
 public function init()
 {
     // klasa dostepna tylko na serwerze testowym
     if (IN_PRODUCTION) {
         throw new Lithium_404_Exception('Error.404');
         return;
     }
     parent::init();
     if (!$this->oAuth->isLoggedIn()) {
         $this->redirect('/');
         echo ' ';
         return;
     }
     $this->mTemplate->sSectionTitle = 'Ustawienia serwisu';
     $this->mTemplate->content = '';
 }