/** * Controller predispatch method * * Called before action method */ public function preDispatch() { parent::preDispatch(); if (!('installer' == strtolower($this->getRequest()->getModuleName()) && 'wizard' == strtolower($this->getRequest()->getControllerName()) && 'finish' == strtolower($this->getRequest()->getActionName())) && Uni_Core_Installer::isInstalled()) { $this->sendRedirect(''); } }
/** * Controller predispatch method * * Called before action method */ function preDispatch() { parent::preDispatch(); if (!Fox::getModel('member/session')->getLoginData()) { if (!('member' === strtolower($this->getRequest()->getModuleName()) && 'account' === strtolower($this->getRequest()->getControllerName()) && 'login' === strtolower($this->getRequest()->getActionName())) && !('member' === strtolower($this->getRequest()->getModuleName()) && 'account' === strtolower($this->getRequest()->getControllerName()) && 'create' === strtolower($this->getRequest()->getActionName())) && !('member' === strtolower($this->getRequest()->getModuleName()) && 'account' === strtolower($this->getRequest()->getControllerName()) && 'forgot-password' === strtolower($this->getRequest()->getActionName())) && !('member' === strtolower($this->getRequest()->getModuleName()) && 'account' === strtolower($this->getRequest()->getControllerName()) && 'verification' === strtolower($this->getRequest()->getActionName())) && !('member' === strtolower($this->getRequest()->getModuleName()) && 'account' === strtolower($this->getRequest()->getControllerName()) && 'change-forget-password' === strtolower($this->getRequest()->getActionName()))) { $this->sendRedirect('member/account/login'); } } else { Fox::getModel('member/session')->setSessionTimeout(Fox::getMemberSessionInterval()); } }
/** * Loades cms page of specified key * * @param Fox_Core_Controller_Action $controller * @param string $key * @return boolean */ public function routKey($controller, $key) { $page = Fox::getModel('cms/page'); $page->load($key, 'url_key'); if ($page->getId() && $page->getStatus()) { if (($container = $page->getLayout()) != '') { $layoutUpdate = '<container key="' . $container . '"/>'; } if (($lUpdate = $page->getLayoutUpdate()) != '') { $layoutUpdate .= $lUpdate; } $layout = $controller->loadLayout($layoutUpdate, $key); $layout->setTitle($page->getTitle()); $layout->setMetaKeywords($page->getMetaKeywords()); $layout->setMetaDescription($page->getMetaDescription()); if ($contentView = $controller->getViewByKey('content')) { $pageView = Fox::getView('cms/page'); $pageView->setPageContent($page->getContent()); $pageView->setPageTitle($page->getTitle()); $pageView->setPageUrlKey($page->getUrlKey()); $contentView->addChild('__page_content__', $pageView); } $controller->renderLayout(); $controller->getResponse()->setHeader('HTTP/1.1', '200 ok'); $controller->getResponse()->setHeader('Status', '200 ok'); $this->routingCompleted = TRUE; } return $this->routingCompleted; }