public static function getInstance() { if (self::$_session === null) { self::$_session = new Core_Session(); } return self::$_session; }
public static function getInstance() { if (self::$_instance === NULL) { self::$_instance = new self(); } return self::$_instance; }
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; }
/** * @param null $set_language * @return int|null|string */ public static function getLanguageCode($set_language) { if (isset(cfg()->language_codes[$set_language])) { return $set_language; } if (Core_Session::hasInstance() && s()->user->language_code !== null) { return s()->user->language_code; } else { foreach (cfg()->language_codes as $language_code => $language_name) { return $language_code; } } 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 static function getInfoSystems() { if (self::$_systemsSession === null) { Zend_Session::start(true); $keys = Core_Session::getIterator()->getArrayCopy(); $data = NULL; foreach ($keys as $key) { $namespace = Core_Session::namespaceGet($key); if (is_object($namespace) && isset($namespace->sistemas)) { $data = $namespace->sistemas; } if (is_array($namespace) && array_key_exists('sistemas', $namespace)) { $data = $namespace['sistemas']; } } if ($data) { return $data; } return array(); } else { return self::$_systemsSession; } }
public function init() { $this->initdb(); $this->session = Core_Session::getInstance(); $this->view->session = $this->session; }
/** * Defined by Zend_Auth_Storage_Interface * * @return void */ public function clear() { return Core_Session::namespaceUnset($this->_getNamespace()); }
/** * @return Core_Session */ function s() { return Core_Session::getInstance(); }