/** * logout */ public function logoutAction() { if (Zend_Session::sessionExists()) { Zend_Session::destroy(true, true); $this->_redirect('/index/login'); } }
function logoutAction() { Zend_Auth::getInstance()->clearIdentity(); require_once 'Zend/Session.php'; Zend_Session::destroy(); $this->_redirect('/'); }
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; }
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(); }
public function logoutAction() { Zend_Session::destroy(); $out['errno'] = '0'; $out['msg'] = Yy_ErrMsg_User::getMsg('logout', $out['errno']); Yy_Utils::jsonOut($out); }
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('/'); }
/** * 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"); } }
public function logoutAction() { Zend_Auth::getInstance()->clearIdentity(); Zend_Session::destroy(true); $this->view->message = "Logged out successfully"; $this->_forward("index", "index", "portal"); }
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; }
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; }
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"; } }
/** * 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/'); }
public function logoutAction() { $this->_helper->layout->disableLayout(true); $this->_helper->viewRenderer->setNoRender(true); Zend_Auth::getInstance()->clearIdentity(); Zend_Session::destroy(); $this->_redirect("/site"); }
public function logoutAction() { $auth = Zend_Auth::getInstance(); $auth->clearIdentity(); // session_destroy(); Zend_Session::destroy(true); $this->render('ajaxsuccessjson'); }
public function logoutAction() { if (Zend_Auth::getInstance()->hasIdentity()) { Zend_Auth::getInstance()->clearIdentity(); } Zend_Session::destroy(); $this->_helper->redirector('index', 'index'); }
public function indexAction() { $session = Zend_Registry::get('session'); Log::Log()->info(__METHOD__ . ' user logged out ' . $this->view->session->authdata['authed_username']); unset($session->authdata); $session->authdata['authed'] = false; Zend_Session::destroy(); }
public function logout() { $userProfileNamespace = new Zend_Session_Namespace('sesion'); $userProfileNamespace->unLock(); $log = new Application_Model_Logs(); $log->crearLog('B'); Zend_Session::destroy(true); }
public function setUser(App_Model_User $user = null) { if ($user == null) { Zend_Session::destroy(); //Logout } else { $this->session->user = $user; } }
public function loginAction() { $this->view->translate()->setLocale(isset($_GET['locale']) ? $_GET['locale'] : 'ru'); $this->view->resource = $this->_request->getParam('resource'); $this->view->headTitle($this->view->translate('Login page')); $this->view->headLink()->appendStylesheet(array('rel' => 'shortcut icon', 'type' => 'image/x-icon', 'href' => '/img/favicon.ico')); $this->view->headLink()->appendStylesheet('/modules/auth/css/login.css'); if ($this->_request->isPost()) { // file_put_contents('d:\\temp\\auth.txt', var_export($this->_request->getParams(), true)); $filter = new Zend_Filter_StripTags(); $username = $filter->filter($this->_request->getParam('username')); $password = $filter->filter($this->_request->getParam('password')); $woredir = $this->_request->getParam('woredir'); if ($woredir) { $this->getHelper('viewRenderer')->setNoRender(); $this->getHelper('layout')->disableLayout(); } if (empty($username)) { $this->_response->setHttpResponseCode(401); // Unauthorized if ($woredir) { echo 'Please, provide a username.'; } else { $this->view->message = 'Please, provide a username.'; } //$this->view->translate('Please provide a username.'); } else { Zend_Session::start(); if (Uman_Auth::login($username, $password)) { Zend_Session::rememberMe(); $auth = Zend_Auth::getInstance(); $identity = $auth->getIdentity(); $ns = new Zend_Session_Namespace('acl'); $ns->acl = new Uman_Acl($identity->NODEID, $identity->PATH); if ($woredir) { echo 'OK'; } else { $this->_redirect($this->_request->getParam('resource', '/')); } } else { $this->_response->setHttpResponseCode(401); // Unauthorized Zend_Session::destroy(); if ($woredir) { echo 'Authorization error. Please, try again.'; } else { $this->view->message = $this->view->translate('Authorization error. Please, try again.'); } } } } else { if (Zend_Session::sessionExists()) { Zend_Session::start(); Zend_Session::destroy(); } } }
public function indexAction() { $noRedirect = (int) $this->_getParam('noRedirection', 0); Zend_Auth::getInstance()->clearIdentity(); Zend_Session::destroy(true); if ($noRedirect === 0) { $this->_redirect(''); } exit; }
public function loginAction() { $request = $this->getRequest(); $user = $request->getParam('login_user'); $password = $request->getParam('login_password'); if ($user != '' && $password != '') { $password = md5($request->getParam('login_password')); $auth = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter()); $auth->setIdentityColumn('idusergslab'); $auth->setCredentialColumn('nmpassword'); $auth->setTableName('usergslab'); $auth->setIdentity($user); $auth->setCredential($password); if (!Zend_Auth::getInstance()->authenticate($auth)->isValid()) { // Quando usuário ou senha inválidos... $this->_redirect('/login/index/error/true'); } else { // Se usuário e senha válidos. $userModel = new UserModel(); $companyModel = new CompanyModel(); $userData = $userModel->fetchRow($userModel->getUserByCompany($user, $request->getParam('company'))); $companyData = $companyModel->fetchRow("cdcompany = " . $request->getParam('company')); if (!$userData || $userData['fgactive'] != 1 || $companyData['fgactive'] != 1) { Zend_Session::destroy(true); $this->_redirect('/login/index/error/lab'); die; } $userSess = new stdClass(); $userSess->cdusergslab = $userData->cdusergslab; $userSess->cdrole = $userData->cdrole; $userSess->cddepartment = $userData->cddepartment; $userSess->cddepartmentsupervisor = $userData->cddepartmentsupervisor; $userSess->idusergslab = $userData->idusergslab; $userSess->nmusergslab = $userData->nmusergslab; $userSess->nmmail = $userData->nmmail; $userSess->idrg = $userData->idrg; $userSess->idcpf = $userData->idcpf; $userSess->nmpassword = $userData->nmpassword; $userSess->nmuserimage = $userData->nmuserimage; $userSess->nmcompanylogo = $companyData->nmcompanylogo; $userSess->cdcompany = $companyData->cdcompany; $userSess->nmcompany = $companyData->nmcompany; $this->setSessionData("user", null, $userSess); $layout = Zend_Layout::getMvcInstance(); $view = $layout->getView(); $view->nmuserimage = $userData->nmuserimage; $data = $auth->getResultRowObject(null); Zend_Auth::getInstance()->getStorage()->write($data); $identity = Zend_Auth::getInstance()->getIdentity(); $this->_redirect('/'); } } else { $this->_redirect($this->baseUrl); } }
/** * 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('/'); }
public function deconnexionAction() { if (Zend_Session::sessionExists()) { $defaultNamespace = new Zend_Session_Namespace(); $defaultNamespace->userid = ''; $defaultNamespace->type = ''; $defaultNamespace->interface_admin = ''; Zend_Session::destroy(); return $this->_redirect('/accueil/index'); } }
public function logoutAction() { // action body //$user = new Zend_Session_Namespace('user'); //unset($user->name);//销毁session Zend_Session::destroy(); //$user = new Zend_Session_Namespace('user'); //echo $user->nickname; //echo '已经安全退出!'; $this->_helper->viewRenderer->setNoRender(); $this->_redirect('/'); }
public function logOutAction() { if (!isset($_SESSION['log'])) { $this->_redirect('admin/index/error'); } $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $sessionMapper = new Cloud_Model_UserSession_CloudUserSessionMapper(); $sessionMapper->deleteSession($_SESSION['userId']); Zend_Session::destroy(true); $this->_redirect('admin/index/login'); }
public function logOutAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); if (!isset($_SESSION['player_log'])) { $this->_redirect('auth/login/'); } $this->sessionMapper->deleteSession($_SESSION['playerId']); Zend_Session::destroy(true); setcookie("Username", "", time() - 60 * 60 * 24 * 30, '/'); setcookie("Password", "", time() - 60 * 60 * 24 * 30, '/'); $this->_redirect(''); }
/** * recognizes a valid session by checking certain additional information stored in the session * often recommended as protection against session fixation/hijacking - but doesnt make much sense * Zend-Framework supports session validators to validate sessions * @return unknown_type */ public function __construct() { try { if (!Zend_Session::isStarted()) { Zend_Session::start(); } } catch (Zend_Session_Exception $e) { Zend_Session::destroy(); Zend_Session::start(); Zend_Session::regenerateId(); } Zend_Session::registerValidator(new Zend_Session_Validator_HttpUserAgent()); }
public function dispatchLoopShutdown() { if (Zend_Session::sessionExists() && Zend_Auth::getInstance()->hasIdentity()) { $ident = Zend_Auth::getInstance()->getIdentity(); $isVaporLogin = in_array($ident['authType'], array(App_Controller_Plugin_Auth::AUTH_TYPE_LOST_PASSWORD, App_Controller_Plugin_Auth::AUTH_TYPE_ASYNC, App_Controller_Plugin_Auth::AUTH_TYPE_EXTERNAL, App_Controller_Plugin_Auth::AUTH_TYPE_THIRD_PARTY, App_Controller_Plugin_Auth::AUTH_TYPE_DOWNLOAD_TOKEN)); if (!$isVaporLogin) { Zend_Session::writeClose(true); } else { Zend_Session::destroy(false); $_SESSION = array(); } } }
public function postDispatch(Zend_Controller_Request_Abstract $request) { parent::postDispatch($request); if ($this->_active) { // get the front controller plugin and the zend error handler $front = Zend_Controller_Front::getInstance(); $error = $front->getPlugin('Daiquiri_Controller_Plugin_ErrorHandler'); // check if an exception is present if (!$error->getResponse()->isException()) { // destroy the session Zend_Session::destroy(); } } }
public function indexAction() { $this->server = new Zend_Amf_Server(); Zend_Session::start(); $this->server->setSession(Amf_Auth::AUTH_NAMESPACE); $this->server->setProduction(false); $this->server->addDirectory('application/services'); $this->server->setAuth(new Amf_Auth()); $this->server->setAcl(new Amf_Acl()); Zend_Session::regenerateId(); $response = $this->server->handle(); Zend_Session::destroy(); if (count($response->getAmfBodies()) > 0) { echo $response; } }