本文整理汇总了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');
}
}
示例2: logoutAction
function logoutAction()
{
Zend_Auth::getInstance()->clearIdentity();
require_once 'Zend/Session.php';
Zend_Session::destroy();
$this->_redirect('/');
}
示例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;
}
示例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();
}
示例5: logoutAction
public function logoutAction()
{
Zend_Session::destroy();
$out['errno'] = '0';
$out['msg'] = Yy_ErrMsg_User::getMsg('logout', $out['errno']);
Yy_Utils::jsonOut($out);
}
示例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('/');
}
示例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");
}
}
示例8: logoutAction
public function logoutAction()
{
Zend_Auth::getInstance()->clearIdentity();
Zend_Session::destroy(true);
$this->view->message = "Logged out successfully";
$this->_forward("index", "index", "portal");
}
示例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;
}
示例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;
}
示例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";
}
}
示例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/');
}
示例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");
}
示例14: logoutAction
public function logoutAction()
{
$auth = Zend_Auth::getInstance();
$auth->clearIdentity();
// session_destroy();
Zend_Session::destroy(true);
$this->render('ajaxsuccessjson');
}
示例15: logoutAction
public function logoutAction()
{
if (Zend_Auth::getInstance()->hasIdentity()) {
Zend_Auth::getInstance()->clearIdentity();
}
Zend_Session::destroy();
$this->_helper->redirector('index', 'index');
}