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


PHP Zend_Session::destroy方法代码示例

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


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

示例1: logoutAction

 /**
  * logout
  */
 public function logoutAction()
 {
     if (Zend_Session::sessionExists()) {
         Zend_Session::destroy(true, true);
         $this->_redirect('/index/login');
     }
 }
开发者ID:rodrigoferrari,项目名称:brasilyacht,代码行数:10,代码来源:HomeController.php

示例2: logoutAction

 function logoutAction()
 {
     Zend_Auth::getInstance()->clearIdentity();
     require_once 'Zend/Session.php';
     Zend_Session::destroy();
     $this->_redirect('/');
 }
开发者ID:Zabu,项目名称:MTA,代码行数:7,代码来源:AuthController.php

示例3: getSession

 public function getSession()
 {
     if (null === $this->_session) {
         $this->getBootstrap()->bootstrap('Session');
         // Get session configuration options from the application.ini file
         $options = $this->getOptions();
         $ApplicationNamespace = new Zend_Session_Namespace('Application');
         // Secutiry tip from http://framework.zend.com/manual/en/zend.session.global_session_management.html
         if (!isset($ApplicationNamespace->initialised)) {
             // FIXME Zend_Session::regenerateId();
             $ApplicationNamespace->initialized = true;
         }
         // ensure IP consistancy
         if (isset($options['checkip']) && $options['checkip'] && isset($_SERVER['REMOTE_ADDR'])) {
             if (!isset($ApplicationNamespace->clientIP)) {
                 $ApplicationNamespace->clientIP = $_SERVER['REMOTE_ADDR'];
             } else {
                 if ($ApplicationNamespace->clientIP != $_SERVER['REMOTE_ADDR']) {
                     // security violation - client IP has changed indicating a possible hijacked session
                     $this->getBootstrap()->bootstrap('Logger');
                     $this->getBootstrap()->getResource('logger')->warn(_('IP address changed - possible session hijack attempt.') . ' ' . _('old') . ": {$ApplicationNamespace->clientIP} " . _('new') . ": {$_SERVER['REMOTE_ADDR']}");
                     Zend_Session::destroy(true, true);
                     die(_('Your IP address has changed indication a possible session hijack attempt. Your session has been destroyed for your own security.'));
                 }
             }
         }
         $this->_session = $ApplicationNamespace;
     }
     return $this->_session;
 }
开发者ID:nereliz,项目名称:ViMbAdmin,代码行数:30,代码来源:Namespace.php

示例4: logoutAction

 public function logoutAction()
 {
     $this->_helper->layout()->disableLayout();
     $serverUrl = 'http://' . AUTH_SERVER . self::AUTH_PATH . '/logout';
     $client = new Zend_Http_Client($serverUrl, array('timeout' => 30));
     try {
         if (isset($_COOKIE[self::AUTH_SID])) {
             $moduleName = $this->getRequest()->getModuleName();
             $client->setCookie('PHPSESSID', $_COOKIE[self::AUTH_SID]);
             $client->setCookie('moduleName', $moduleName);
             $response = $client->request();
             if ($response->isError()) {
                 $remoteErr = $remoteErr = 'REMOTE ERROR: (' . $response->getStatus() . ') ' . $response->getMessage() . ', i.e. ' . $response->getHeader('Message');
                 throw new Zend_Exception($remoteErr, Zend_Log::ERR);
             }
         } else {
             $this->_helper->logger('No remote cookie found. So, not requesting AUTH_SERVER to logout.');
         }
     } catch (Zend_Exception $e) {
         echo $e->getMessage();
     }
     preg_match('/[^.]+\\.[^.]+$/', $_SERVER['SERVER_NAME'], $domain);
     if (isset($_COOKIE[self::AUTH_SID])) {
         setcookie(self::AUTH_SID, '', time() - 360000, self::AUTH_PATH, ".{$domain['0']}");
     }
     if (isset($_COOKIE['last'])) {
         setcookie('last', '', time() - 36000, '/', ".{$domain['0']}");
     }
     if (isset($_COOKIE['identity'])) {
         setcookie('identity', '', time() - 36000, '/', ".{$domain['0']}");
     }
     Zend_Auth::getInstance()->clearIdentity();
     Zend_Session::destroy();
     Zend_Session::regenerateId();
 }
开发者ID:sivarajankumar,项目名称:eduis,代码行数:35,代码来源:AuthenticateController.php

示例5: logoutAction

 public function logoutAction()
 {
     Zend_Session::destroy();
     $out['errno'] = '0';
     $out['msg'] = Yy_ErrMsg_User::getMsg('logout', $out['errno']);
     Yy_Utils::jsonOut($out);
 }
开发者ID:baiooy,项目名称:hqimt_backend,代码行数:7,代码来源:UserController.php

示例6: indexAction

 public function indexAction()
 {
     Zend_Session::destroy();
     //code taken frome http://www.zfforums.com/zend-framework-components-13/model-view-controller-mvc-21/there-no-render-option-view-811.html#post2286
     $this->getHelper('viewRenderer')->setNoRender();
     $this->_redirect('/');
 }
开发者ID:kakarot1991,项目名称:paid-to-click-cms,代码行数:7,代码来源:logoutController.php

示例7: preDispatch

 /**
  * Predispatch method to authenticate user
  *
  * @param Zend_Controller_Request_Abstract $request
  */
 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     //user only to login for access to admin functions
     /*if ('admin' != $request->getModuleName()) {
           return;
       }
        
       if (App_Model_Users::isLoggedIn() && App_Model_Users::isAdmin()) {
           //user is logged in and allowed to access admin functions
           return;
       }*/
     if ('admin' == $request->getModuleName()) {
         return;
     }
     /**
      * User not logged in or not allowed to access admin ... redirect to login.
      * Note: if user is logged in but not authorised, we redirect to login
      * to allow user to login as a different user with the right permissions.
      */
     Zend_Session::destroy(true);
     if ($request->getActionName() != 'logincheck') {
         $request->setModuleName('default')->setControllerName('login')->setActionName('index');
         //->setDispatched(FALSE);
         header("Location:http://" . $_SERVER['HTTP_HOST'] . "/login/index");
     }
 }
开发者ID:nainit-virtueinfo,项目名称:zend-rest,代码行数:31,代码来源:Auth.php

示例8: logoutAction

 public function logoutAction()
 {
     Zend_Auth::getInstance()->clearIdentity();
     Zend_Session::destroy(true);
     $this->view->message = "Logged out successfully";
     $this->_forward("index", "index", "portal");
 }
开发者ID:juliomolinero,项目名称:onelogin-api-php,代码行数:7,代码来源:IndexController.php

示例9: indexAction

 public function indexAction()
 {
     //users cannot register as advertisers
     $session = new Zend_Session_Namespace('user');
     if ($session->user != null) {
         //$this->_redirect('/user');
         Zend_Session::destroy();
         //return;
     }
     $form = new Advertiser_Models_Forms_Registration();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($_POST)) {
             $advertiser = new Advertiser_Models_Advertiser($_POST);
             $advertiser->banReason = '';
             $advertiser->balance = '';
             $advertiser->status = 'pending';
             $advertiser->IP = $_SERVER['REMOTE_ADDR'];
             $errorCode = $advertiser->register();
             if ($errorCode != Advertiser_Models_Advertiser::SUCCESS) {
                 $this->view->formErrors = $errorCode;
             } else {
                 $this->_redirect('/advertiser');
                 return;
             }
         }
     }
     $this->view->form = $form;
 }
开发者ID:kakarot1991,项目名称:paid-to-click-cms,代码行数:28,代码来源:registerController.php

示例10: indexAction

 public function indexAction()
 {
     // shares/avatar files are deleted by an off-line routine in crontab
     $request = $this->getRequest();
     $registry = Zend_Registry::getInstance();
     $auth = Zend_Auth::getInstance();
     $credential = Ml_Model_Credential::getInstance();
     $peopleDelete = Ml_Model_PeopleDelete::getInstance();
     $signedUserInfo = $registry->get("signedUserInfo");
     $form = $peopleDelete->deleteAccountForm();
     if ($request->isPost()) {
         $credentialInfo = $credential->getByUid($auth->getIdentity());
         if (!$credentialInfo) {
             throw new Exception("Fatal error on checking credential in account delete controller.");
         }
         $registry->set('credentialInfoDataForPasswordChange', $credentialInfo);
         if ($form->isValid($request->getPost())) {
             $registry->set("canDeleteAccount", true);
             $peopleDelete->deleteAccount($signedUserInfo, sha1(serialize($signedUserInfo)));
             $auth->clearIdentity();
             Zend_Session::namespaceUnset('Zend_Auth');
             Zend_Session::regenerateId();
             Zend_Session::destroy(true);
             $this->_redirect("/account/terminated", array("exit"));
         }
     }
     $this->view->deleteAccountForm = $form;
 }
开发者ID:henvic,项目名称:MediaLab,代码行数:28,代码来源:AccountdeleteController.php

示例11: init

 public function init()
 {
     parent::init();
     $ns = new Zend_Session_Namespace('user');
     $general = new Application_Model_General();
     $statUser = $general->veriStatUser($ns->data);
     if (!empty($ns->data)) {
         $this->view->firstname = $ns->data['firstname_user'];
         $this->view->lastname = $ns->data['lastname_user'];
         $this->view->lvl = $ns->data['id_rank'];
     }
     if ($statUser == 1 or $statUser == 2) {
         $this->view->isadmin = $statUser;
     } else {
         if ($statUser == 3) {
             Zend_Session::namespaceUnset("user");
             Zend_Session::destroy(true);
             $this->_redirect($this->view->url(array('controller' => 'index', 'action' => 'acces'), null, true));
         }
     }
     $this->category = new Application_Model_Category();
     if ($this->_getParam('message') != null) {
         $this->view->message = "Modification sauvegarder";
     }
 }
开发者ID:nitishpeeroo,项目名称:Telemaque,代码行数:25,代码来源:ArticleController.php

示例12: indexAction

 /**
  * Processa a saída do usuário do sistema, limpando suas credenciais
  */
 public function indexAction()
 {
     $auth = Zend_Auth::getInstance();
     $auth->clearIdentity();
     DBSeller_Plugin_Notificacao::limpar();
     Zend_Session::destroy();
     $this->redirect('/auth/login/');
 }
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:11,代码来源:LogoutController.php

示例13: logoutAction

 public function logoutAction()
 {
     $this->_helper->layout->disableLayout(true);
     $this->_helper->viewRenderer->setNoRender(true);
     Zend_Auth::getInstance()->clearIdentity();
     Zend_Session::destroy();
     $this->_redirect("/site");
 }
开发者ID:nandorodpires2,项目名称:intranet,代码行数:8,代码来源:AuthController.php

示例14: logoutAction

 public function logoutAction()
 {
     $auth = Zend_Auth::getInstance();
     $auth->clearIdentity();
     //		session_destroy();
     Zend_Session::destroy(true);
     $this->render('ajaxsuccessjson');
 }
开发者ID:Koulio,项目名称:OpenZIS,代码行数:8,代码来源:IndexController.php

示例15: logoutAction

 public function logoutAction()
 {
     if (Zend_Auth::getInstance()->hasIdentity()) {
         Zend_Auth::getInstance()->clearIdentity();
     }
     Zend_Session::destroy();
     $this->_helper->redirector('index', 'index');
 }
开发者ID:VaN-dev,项目名称:migration-zf1-sf2,代码行数:8,代码来源:IndexController.php


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