AuthController::logoutAction PHP Method

logoutAction() public method

public logoutAction ( )
    public function logoutAction()
    {
        if ($this->auth->hasIdentity()) {
            $this->auth->clearIdentity();
        }
        setcookie('NO_CACHE', 'NO', time() - 3600, '/', '.' . $this->extractDomain($_SERVER['HTTP_HOST']));
        $url = $this->_getParam('url');
        if (!is_null($url)) {
            $this->_redirect($url);
        }
        $this->_helper->redirector->gotoUrl('?t=' . time());
    }

Usage Example

Ejemplo n.º 1
0
 /*
 if (Core::$config['current_language'] == 'en') {
 	go('/ru/');
 }
 */
 core::$config['http_home'] = core::$config['http_root'] . core::$config['current_language'] . '/';
 if (preg_match('/^login\\/(|\\?.*)$/Uu', $url, $matches)) {
     require_once 'AuthController.php';
     $controller = new AuthController();
     echo $controller->loginAction();
     die;
 }
 if (preg_match('/^logout\\/(|\\?.*)$/Uu', $url, $matches)) {
     require_once 'AuthController.php';
     $controller = new AuthController();
     echo $controller->logoutAction();
     die;
 }
 if (preg_match('/^register\\/(|\\?.*)$/Uu', $url, $matches)) {
     require_once 'AuthController.php';
     $controller = new AuthController();
     echo $controller->registerAction();
     die;
 }
 if (preg_match('/^lost_password\\//Uu', $url, $matches)) {
     require_once 'AuthController.php';
     $controller = new AuthController();
     if (preg_match('/^lost_password\\/(|\\?.*)$/Uu', $url, $matches)) {
         echo $controller->lostPasswordAction();
         die;
     }