public function __construct()
 {
     parent::__construct();
     //if (!isset($_SESSION['logged'])) {
     $this->rememberBackLink();
     //}
 }
 public function __construct()
 {
     parent::__construct();
     $data['fullname'] = $nameAdmin = $this->app['session']->get('admin', '1');
     if ($nameAdmin == 1) {
         return $this->redirect('logout-admin');
     }
 }
 public function __construct()
 {
     parent::__construct();
     if ($authed = $this->app['session']->get('admin_authed', false)) {
         $this->authed = $authed;
     } else {
         $response = $this->redirect('admin_login');
         $response->send();
         return $this->app->terminate($this->request, $response);
     }
 }
Пример #4
0
 public function __construct()
 {
     parent::__construct();
     $this->method = $this->request->getMethod();
     if (in_array($this->method, ['POST', 'PUT'])) {
         $content = $this->request->getContent();
         $this->post_data = json_decode($content, true);
     }
     ErrorHandler::register();
     $app = $this->app;
     $app->error(function (ModelNotFoundException $e, $code) use($app) {
         $models = explode('\\', $e->getModel());
         return $app->json(['error' => last($models) . ' does not exists.', 'status_code' => Response::HTTP_NOT_FOUND], Response::HTTP_NOT_FOUND);
     }, 0);
 }
Пример #5
0
 public function __construct()
 {
     parent::__construct();
 }