当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Session::forgetMe方法代码示例

本文整理汇总了PHP中Zend_Session::forgetMe方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Session::forgetMe方法的具体用法?PHP Zend_Session::forgetMe怎么用?PHP Zend_Session::forgetMe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Session的用法示例。


在下文中一共展示了Zend_Session::forgetMe方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: logoutAction

 public function logoutAction()
 {
     Zend_Session::forgetMe();
     $client = Infra_ClientHelper::getClient();
     $client->session->end();
     Infra_AuthHelper::getAuthInstance()->clearIdentity();
     $this->_helper->redirector('index', 'index');
 }
开发者ID:kubrickfr,项目名称:server,代码行数:8,代码来源:UserController.php

示例2: logout

 /**
  * Destroys the session of the user currently logged in.
  * @param boot $cms whether to log out of the cms as well
  * @return array $response
  */
 public function logout($cms = true)
 {
     $cookies = array();
     // get the auth singleton, clear the identity and redirect.
     Zend_Auth::getInstance()->clearIdentity();
     Zend_Session::forgetMe();
     return array('status' => 'redirect', 'cookies' => $cookies);
 }
开发者ID:vrtulka23,项目名称:daiquiri,代码行数:13,代码来源:Login.php

示例3: logoutAction

 /**
  * Logs the user off. The identity is removed and the session is cleared.
  */
 public function logoutAction()
 {
     Zend_Auth::getInstance()->clearIdentity();
     Zend_Session::forgetMe();
     unset($this->_defaultNamespace->user);
     $this->_helper->flashMessenger->addMessage('Sie wurden erfolgreich vom System abgemeldet.');
     $this->_helper->redirector('index', 'index');
 }
开发者ID:rusli-nasir,项目名称:iHealth,代码行数:11,代码来源:AuthController.php

示例4: logoutAction

 /**
  * Logout request comes to this action.
  */
 public function logoutAction()
 {
     $auth = Zend_Auth::getInstance();
     $auth->setStorage(new Zend_Auth_Storage_Session('user'));
     if ($auth->hasIdentity()) {
         $auth->clearIdentity();
         Zend_Session::forgetMe();
     }
     Zend_Session::destroy();
     $this->_redirect('/');
 }
开发者ID:Genius-Outsourcing-Pvt-Ltd,项目名称:pathology,代码行数:14,代码来源:LoginController.php

示例5: authenticate

 /**
  * Authenticate a user
  *
  * @param  array $data Matched pair array containing email/password
  * @return boolean
  */
 public function authenticate($data)
 {
     $adapter = $this->getAuthAdapter($data);
     $auth = $this->getAuth();
     $result = $auth->authenticate($adapter);
     if (!$result->isValid()) {
         return false;
     }
     if ($data['save-login']) {
         Zend_Session::rememberMe();
     } else {
         Zend_Session::forgetMe();
     }
     $user = $this->_userModel->findByEmail($data['email']);
     $auth->getStorage()->write($user->toArray());
     return true;
 }
开发者ID:rickyfeng,项目名称:wenda,代码行数:23,代码来源:Authentication.php

示例6: proceedAction

 public function proceedAction()
 {
     // double check upgrade is necessary in case someone access this action directly
     if (!$this->_needsUpgrade()) {
         $this->_redirect('');
         return;
     }
     $form = new Install_Form_UpgradeLogin();
     $formData = $this->_request->getPost();
     $form->populate($formData);
     if (!$form->isValid($formData)) {
         $appSession = Zend_Registry::get('appSession');
         $appSession->loginForm = $form;
         $this->_forward('index');
         return;
     }
     $users = new Users_Model_Users();
     list($super, $mayor, $minor) = explode('.', $this->_getDbVersion());
     $greaterThan2 = $super >= 2;
     $result = $users->authenticate($this->_request->getPost('username'), $this->_request->getPost('password'), false, $this->view, !$greaterThan2);
     if (!$result) {
         $this->_helper->FlashMessenger->addMessage($this->view->translate('Invalid credentials'));
         $this->_redirect('index');
         return;
     }
     $user = $users->getUser();
     if ($user->role != Users_Model_User::ROLE_ADMIN) {
         Zend_Auth::getInstance()->clearIdentity();
         $this->_helper->FlashMessenger->addMessage($this->view->translate('Invalid credentials'));
         $this->_redirect('index');
         return;
     }
     $this->_runUpgrades(true);
     $upgradedVersion = $this->_runUpgrades(false);
     $this->_helper->FlashMessenger->addMessage($this->view->translate('Upgrade was successful. You are now on version %s', $upgradedVersion));
     $missingConfigs = $this->_checkMissingConfigDirectives();
     if ($missingConfigs) {
         $this->_helper->FlashMessenger->addMessage($this->view->translate('WARNING: there are some new configuration settings. To override their default values (as set in config.default.php) add them to your config.php file. The new settings correspond to the following directives: %s.', implode(', ', $missingConfigs)));
     }
     // we need to logout user in case the user table changed
     Zend_Auth::getInstance()->clearIdentity();
     Zend_Session::forgetMe();
     $this->_redirect('/');
 }
开发者ID:sdgdsffdsfff,项目名称:auth-center,代码行数:44,代码来源:UpgradeController.php

示例7: fastlogin

 /**
  * ACL Login
  *
  * @param string $email
  * @param string $password
  * @return Zend_Auth_Result | boolean
  */
 public static function fastlogin($email, $password, $rememberMe = false)
 {
     if (!empty($email) && !empty($password)) {
         $adapter = new Shineisp_Auth_Adapter_Doctrine(Doctrine_Manager::connection()->getTable("AdminUser"), "email", "password");
         $adapter->setCredential($password);
         $adapter->setIdentity($email);
         if ($rememberMe) {
             // remember the session for 604800s = 7 days
             Zend_Session::rememberMe(604800);
         } else {
             // do not remember the session
             Zend_Session::forgetMe();
         }
         $auth = Zend_Auth::getInstance();
         $auth->setStorage(new Zend_Auth_Storage_Session('admin'));
         return $auth->authenticate($adapter);
     } else {
         return false;
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:27,代码来源:AdminUser.php

示例8: postAction

 /**
  * Login
  *
  * @return void
  */
 public function postAction()
 {
     // Get params
     $userName = $this->_request->getParam('userName');
     $password = $this->_request->getParam('password');
     $rememberMe = $this->_request->getParam('rememberMe');
     // Check rememberMe checkbox
     if (is_null($rememberMe)) {
         Zend_Session::forgetMe();
     }
     if ($this->getRequest()->isPost() && Kebab_Validation_UserName::isValid($userName) && Kebab_Validation_Password::isValid($password)) {
         $hasIdentity = Kebab_Authentication::signIn($userName, $password, !is_null($rememberMe));
         if ($hasIdentity) {
             $this->_helper->response(true, 200)->getResponse();
         } else {
             $this->_helper->response()->addNotification(Kebab_Notification::ERR, 'Please check your user name and password!')->getResponse();
         }
     } else {
         $this->_helper->response()->getResponse();
     }
 }
开发者ID:esironal,项目名称:kebab-project,代码行数:26,代码来源:SessionController.php

示例9: preDispatch

 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     if (!in_array($request->getModuleName(), $this->modules)) {
         return;
     }
     $authInstance = Zend_Auth::getInstance();
     //SAML login:
     if (isset($_SERVER['eppn'])) {
         //lookup user with this eduPersonPrincipalName:
         $model = new OpenSKOS_Db_Table_Users();
         $user = $model->fetchRow($model->select()->where('eppn=?', $_SERVER['eppn']));
         if (null !== $user) {
             if ($user->active != 'Y') {
                 Zend_Auth::getInstance()->clearIdentity();
                 Zend_Session::forgetMe();
                 Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->setNamespace('error')->addMessage(_('Your account is blocked.'));
                 Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->direct('index', 'index', 'website');
             }
             $login = new Editor_Models_Login();
             $login->getStorage()->write($user);
             return;
         }
     }
     $resource = $request->getControllerName();
     $actionName = $request->getActionName();
     if ($authInstance->hasIdentity()) {
         if ($authInstance->getIdentity()->active != 'Y') {
             Zend_Auth::getInstance()->clearIdentity();
             Zend_Session::forgetMe();
             Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger')->setNamespace('error')->addMessage(_('Your account is blocked.'));
             Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->direct('index', 'index', 'website');
         }
     } else {
         if ($request->getControllerName() != 'login') {
             Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->direct('index', 'login', 'editor');
         }
     }
 }
开发者ID:olhsha,项目名称:OpenSKOS2tempMeertens,代码行数:38,代码来源:Auth.php

示例10: logoutAction

 /**
  * Processes the log out action
  * @return void
  */
 public function logoutAction()
 {
     // Clean cookie
     Sydney_Http_Cookie::cleanAuthCookie();
     Sydney_Auth::getInstance()->clearIdentity();
     Zend_Session::forgetMe();
     Zend_Session::destroy();
     $this->logger->log('User logged OUT', Zend_Log::NOTICE);
     $this->redirect('/');
 }
开发者ID:Cryde,项目名称:sydney-core,代码行数:14,代码来源:LoginController.php

示例11: logout

 /**
  * Logout current user
  *
  * @return void
  */
 public function logout()
 {
     $this->_auth->clearIdentity();
     Zend_Session::forgetMe();
 }
开发者ID:JellyBellyDev,项目名称:zle,代码行数:10,代码来源:UserAbstract.php

示例12: login

 /**
  * Logs an user in the application based on his
  * username and email
  * 
  * @param string $username
  * @param string $password
  * @param boolean $remember
  * @access public
  * @return void
  */
 public function login($username, $password, $remember = FALSE)
 {
     // adapter cfg
     $adapter = new Zend_Auth_Adapter_DbTable($this->_db);
     $adapter->setTableName($this->_name);
     $adapter->setIdentityColumn('username');
     $adapter->setCredentialColumn('password');
     // checking credentials
     $adapter->setIdentity($username);
     $adapter->setCredential(BaseUser::hashPassword($password));
     try {
         $result = $adapter->authenticate();
     } catch (Zend_Auth_Adapter_Exception $e) {
         App_Logger::log(sprintf("Exception catched while login: %s", $e->getMessage()), Zend_Log::ERR);
         return FALSE;
     }
     if ($result->isValid()) {
         // get the user row
         $loggedUser = $adapter->getResultRowObject(NULL, 'password');
         //Check if the account has been closed
         if ($loggedUser->deleted) {
             return NULL;
         }
         // clear the existing data
         $auth = Zend_Auth::getInstance();
         $auth->clearIdentity();
         if (!empty($loggedUser->id)) {
             switch (CURRENT_MODULE) {
                 case 'frontend':
                     $userModel = new User();
                     $user = $userModel->findById($loggedUser->id);
                     $user->get('group');
                     $session = new stdClass();
                     foreach (get_object_vars($loggedUser) as $k => $v) {
                         $session->{$k} = $v;
                     }
                     $session->group->name = $user->get('group')->name;
                     break;
                 case 'backoffice':
                     $userModel = new BackofficeUser();
                     $user = $userModel->findById($loggedUser->id);
                     $user->groups = $user->findManyToManyRowset('Group', 'BackofficeUserGroup');
                     $user->group = $user->groups[0];
                     $session = new stdClass();
                     foreach (get_object_vars($loggedUser) as $k => $v) {
                         $session->{$k} = $v;
                     }
                     $session->group->name = $user->group->name;
                     break;
             }
             $auth->getStorage()->write($session);
         }
         $this->update(array('last_login' => new Zend_Db_Expr('NOW()')), $this->_db->quoteInto('id = ?', $user->id));
         if ($rememberMe) {
             Zend_Session::rememberMe(App_DI_Container::get('ConfigObject')->session->remember_me->lifetime);
         } else {
             Zend_Session::forgetMe();
         }
         return TRUE;
     } else {
         return FALSE;
     }
 }
开发者ID:nic162,项目名称:Zend-Framework-Skeleton,代码行数:73,代码来源:BaseUser.php

示例13: logoutAction

 public function logoutAction()
 {
     Zend_Session::namespaceUnset('superadmin');
     Zend_Auth::getInstance()->clearIdentity();
     Zend_Session::forgetMe();
     $this->_helper->FlashMessenger->addMessage(array('message' => 'Successfully logged out.'));
     $this->_redirect('');
 }
开发者ID:relyd,项目名称:aidstream,代码行数:8,代码来源:UserController.php

示例14: forgetMe

 /**
  * セッション終了時に有効期限が切れるように変更
  *
  * @static
  * @access public
  */
 public static function forgetMe()
 {
     parent::forgetMe();
 }
开发者ID:noriotakei,项目名称:suraimu,代码行数:10,代码来源:ComSession.php

示例15: signOut

 public static function signOut()
 {
     Zend_Auth::getInstance()->clearIdentity();
     Zend_Session::forgetMe();
 }
开发者ID:esironal,项目名称:kebab-project,代码行数:5,代码来源:Authentication.php


注:本文中的Zend_Session::forgetMe方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。