Beispiel #1
0
 public function __construct(LiveCart $application)
 {
     if ($application->getConfig()->get('SSL_BACKEND')) {
         $application->getRouter()->setSslAction('');
     }
     parent::__construct($application);
     if (!isset($_SERVER['HTTP_USER_AGENT'])) {
         $_SERVER['HTTP_USER_AGENT'] = 'Firefox';
     }
     // no IE yet
     if (preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT'])) {
         ClassLoader::import('application.controller.backend.UnsupportedBrowserException');
         throw new UnsupportedBrowserException();
     }
     if (!$this->user->hasBackendAccess() && !$this instanceof SessionController) {
         SessionUser::destroy();
         $url = $this->router->createUrl(array('controller' => 'backend.session', 'action' => 'index', 'query' => array('return' => $_SERVER['REQUEST_URI'])));
         if (!$this->isAjax()) {
             header('Location: ' . $url);
         } else {
             header('Content-type: text/javascript');
             echo json_encode(array('__redirect' => $url));
         }
         exit;
     }
 }
Beispiel #2
0
 public function logout()
 {
     SessionUser::destroy();
     return new ActionRedirectResponse('backend.session', 'index');
 }