Ejemplo n.º 1
0
 public function before()
 {
     parent::before();
     $this->_ctx = Context::instance();
     $this->_ctx->request($this->request)->response($this->response);
     View_Front::bind_global('ctx', $this->_ctx);
 }
Ejemplo n.º 2
0
 public function before()
 {
     if (PHP_SAPI != 'cli') {
         throw new Http_Exception_403('Доступ запрещен');
         return;
     }
     parent::before();
 }
Ejemplo n.º 3
0
 public function before()
 {
     parent::before();
     if ($this->auth_required === TRUE and !Auth::is_logged_in() and !in_array($this->request->action(), $this->public_actions)) {
         $this->_deny_access();
     }
     if ($this->auth_required === TRUE and !in_array($this->request->action(), $this->allowed_actions) and !ACL::check($this->request)) {
         $this->_deny_access();
     }
 }
Ejemplo n.º 4
0
 public function before()
 {
     parent::before();
     //					 if (isset($this->request->post('exit')) OR isset($this->request->query('exit')))
     //           {
     //							Auth::instance()->logout();
     //							$this->redirect(URL::base(true));
     //            }
     $action_name = $this->request->action();
     // Проверяем права на доступ к текущей странице
     if ($this->auth_required !== FALSE and Auth::instance()->logged_id($this->auth_required) === FALSE or is_array($this->secure_actions) and array_key_exists($action_name, $this->secure_actions) and Auth::instance()->logged_in($this->secure_actions[$action_name]) === FALSE) {
         // Если нет прав и AJAX запрос, то выдаем эксепшен
         if (Auth::instance()->logged_in() or $this->request->is_ajax()) {
             throw new HTTP_Exception_403('У вас нет прав доступа к текущей странице');
         } else {
             $this->request->redirect(Route::url('user', array('action' => 'login', 'next_url' => rawurldecode(Request::current()->uri()))));
         }
     }
 }
Ejemplo n.º 5
0
 public function after()
 {
     parent::after();
     Observer::notify('frontpage_after_render');
 }