public function logoutAction() { $this->_noRender = true; $session = Core_Session::getInstance(); $session->destroy(); $this->redirect(array('route' => 'route_admin')); }
public static function hasIdentity() { $session = Core_Session::getInstance(); if ($session->get('username', 'auth') && $session->get('user_agent', 'auth') == $_SERVER['HTTP_USER_AGENT'] && $session->get('ip', 'auth') == $_SERVER['REMOTE_ADDR']) { return true; } return false; }
public function init() { // Cache $frontEnd = array('lifetime' => null, 'automatic_serialization' => 'true'); $backEnd = array('cache_dir' => CACHE_PATH . '/db'); $this->_cache['db'] = Zend_Cache::factory('Core', 'File', $frontEnd, $backEnd); // Set data $this->view->adminUrl = BASE_URL . '/admin'; $this->view->baseUrl = BASE_URL; $this->view->setTheme('admin'); if (!User_Helper_Auth::hasIdentity()) { $this->setTemplate('module/user/admin/login'); } else { // Set session $this->_session = Core_Session::getInstance(); $this->view->username = $this->_session->get('username', 'auth'); } }
public function init() { $this->initdb(); $this->session = Core_Session::getInstance(); $this->view->session = $this->session; }
/** * @return Core_Session */ function s() { return Core_Session::getInstance(); }