public function render() { try { $this->currentModule = Core_Helper::getModule(); //$this->userLogin = Core_Helper::getCurrentUserLogin(); $this->url = Core_Url::getCurrentUrl(); //$this->token_auth = Core_Core::getCurrentUserTokenAuth(); //$this->userHasSomeAdminAccess = Core_Core::isUserHasSomeAdminAccess(); //$this->userIsSuperUser = Core_Core::isUserIsSuperUser(); //$this->Core_version = Core_Version::VERSION; //$this->latest_version_available = UpdateCheck::isNewestVersionAvailable(); //$this->loginModule = Zend_Registry::get('auth')->getName(); // global value accessible to all templates: the // Core base URL for the current request $this->Core_Url = Core_Url::getCurrentUrlWithoutFileName(); /* The navigation menu */ $this->Core_NavigationMenu = Core_Navigator::getInstance()->getMenu(); $this->InternetIsConnected = Zend_Registry::get('config')->General->internet_is_connected == 1; $this->MapData = Zend_Registry::get('config')->General->map_data; } catch (Exception $e) { // can fail, for example at installation (no plugin loaded yet) } //$this->totalTimeGeneration = Zend_Registry::get('timer')->getTime(); /* try { $this->totalNumberOfQueries = Core_Common::getQueryCount(); } catch(Exception $e){ $this->totalNumberOfQueries = 0; }*/ @header('Content-Type: text/html; charset=utf-8'); @header("Pragma: "); @header("Cache-Control: no-store, must-revalidate"); return $this->smarty->fetch($this->template); }
/** * */ function preDispatch() { $currentLogin = Core_Common::getCurrentUserLogin(); $currentModule = Core_Helper::getModule(); $loginModule = Core_Helper::getLoginModuleName(); if ($currentModule !== $loginModule && (empty($currentLogin) || $currentLogin === 'anonymous')) { Core_Helper::redirectToModule($loginModule); } }
function initAuthenticationObject($notification) { $auth = new Module_Login_Auth(); Zend_Registry::set('auth', $auth); $action = Core_Helper::getAction(); if (Core_Helper::getModule() === 'API' && (empty($action) || $action == 'index')) { return; } /* Create the cookie */ $authCookieName = Zend_Registry::get('config')->General->login_cookie_name; $authCookieExpiry = 0; $authCookiePath = Zend_Registry::get('config')->General->login_cookie_path; $authCookie = new Core_Cookie($authCookieName, $authCookieExpiry, $authCookiePath); $defaultLogin = '******'; $defaultTokenAuth = 'anonymous'; if ($authCookie->isCookieFound()) { $defaultLogin = $authCookie->get('login'); $defaultTokenAuth = $authCookie->get('token_auth'); } $auth->setLogin($defaultLogin); $auth->setTokenAuth($defaultTokenAuth); }
/** * Returns the plugin currently being used to display the page * * @return Core_Module */ public static function getCurrentModule() { return Core_ModuleManager::getInstance()->getLoadedModule(Core_Helper::getModule()); }