Пример #1
0
 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
 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 = '';
 }