public function indexAction()
 {
     Kwf_Auth::getInstance()->clearIdentity();
     Kwf_User_Autologin::clearCookies();
     Kwf_Session::destroy();
     Kwf_Util_Redirect::redirect($this->_getParam('redirect'));
 }
 public static function initForTests()
 {
     Kwf_Session::start();
     Kwf_Util_MemoryLimit::set(512);
     Kwf_Component_Data_Root::setComponentClass(false);
     Zend_Registry::set('db', Kwf_Test::getTestDb());
     set_time_limit(0);
     Kwf_Benchmark::disable();
 }
 protected function _afterSave(Kwf_Model_Row_Interface $row)
 {
     parent::_afterSave($row);
     $user = Kwf_Registry::get('userModel')->getAuthedUser();
     $user->deleted = 1;
     $user->save();
     Kwf_Auth::getInstance()->clearIdentity();
     Kwf_User_Autologin::clearCookies();
     Kwf_Session::destroy();
 }
示例#4
0
 public static function ensureHttp()
 {
     if (php_sapi_name() != 'cli') {
         if (isset($_SERVER['HTTPS']) && $_SERVER['REQUEST_METHOD'] != 'POST' && !Kwf_Session::sessionExists()) {
             $redirect = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
             header('Location: ' . $redirect, true, 302);
             Kwf_Benchmark::shutDown();
             exit;
         }
     }
 }
 public function replaceOutput($renderer)
 {
     $facebook = Kwf_Util_Facebook_Api::getInstance();
     //no redirect if cli, or address contains assets, admin or kwf
     if (PHP_SAPI != 'cli' && !preg_match('#^/admin|^/kwf|^/assets#', $_SERVER['REQUEST_URI'])) {
         if (!isset($_COOKIE[session_name()])) {
             Kwf_Session::start();
             if (!isset($_COOKIE[session_name()])) {
                 $serverDomain = 'http://' . Kwf_Config::getValue('server.domain');
                 return "<script>top.location.href=\"{$serverDomain}/home\";</script>";
             }
         }
     }
     return false;
 }
 public function logoutAction()
 {
     Kwf_Auth::getInstance()->clearIdentity();
     Kwf_Session::destroy();
     $this->_onLogout();
 }
 public function save()
 {
     \Kwf_Session::writeClose();
     $this->closed = true;
     $this->started = false;
 }
 public function __construct($namespace = 'Default', $singleInstance = false)
 {
     parent::__construct($namespace, $singleInstance);
     Kwf_Session::afterStart();
 }