示例#1
0
 public function logoutAction()
 {
     /** @todo: XSRF protection **/
     /* $token = $this->_getParam('requestToken'); */
     Stoa_Model_User::logoutCurrentUser();
     $this->_redirect('/');
 }
示例#2
0
 /**
  * Initialize the session 
  * 
  * @return Zend_Session_Namespace
  */
 protected function _initSession()
 {
     $this->bootstrap(array('autoloader', 'request', 'config'));
     $sessionOpts = $this->getOption('session');
     if ($sessionOpts && isset($sessionOpts['name'])) {
         $sessName = $sessionOpts['name'];
     } else {
         $sessName = 'stoaSession';
     }
     Zend_Session::setOptions(array('name' => $sessName, 'use_only_cookies' => true, 'cookie_path' => $this->getResource('request')->getBaseUrl()));
     Stoa_Model_User::setConfig(new Zend_Config($this->getOption('auth')));
     Zend_Auth::getInstance()->setStorage(new Geves_Auth_Storage_LazySession());
     // We only start the session automatically if it was already started
     // at some point
     if (isset($_COOKIE[$sessName])) {
         return new Zend_Session_Namespace('stoa');
     }
 }
示例#3
0
文件: User.php 项目: shevron/stoa
 public static function setConfig(Zend_Config $config)
 {
     self::$_config = $config;
 }