function run() { // load CSS $this->head($this->getCssSrcComponent(self::CSS_FILENAME)); try { if (!$this->pageExists()) { //try second chance... $oRedirectPage = $this->getoPage()->getSecondChance(); if ($oRedirectPage) { //save _POST AnwUtils::httpPostToSession(); //save _GET $asParams = $_GET; unset($asParams[AnwActionPage::GET_PAGENAME]); //avoid loop $sLink = AnwUtils::link($oRedirectPage->getName(), 'view', $asParams); AnwUtils::redirect($sLink); } else { $this->pagenotfound(); } } $this->showCurrentPage(); } catch (AnwBadPageNameException $e) { $this->error(self::g_("err_badpagename")); } }
protected function checkReauth() { if (AnwCurrentSession::needsReauth()) { AnwUtils::httpPostToSession(); $this->doReauthForm(); exit; } }
function redirectIfTranslationAvailable($sLang) { if ($this->getLang() != $sLang) { $aoTranslations = $this->getPageGroup()->getPages(); if (isset($aoTranslations[$sLang])) { //translation found, let's redirect $oGoodPage = $aoTranslations[$sLang]; if ($oGoodPage->isActionAllowed('view')) { self::debug("redirectIfTranslationAvailable(" . $sLang . "): translation found"); //save _POST AnwUtils::httpPostToSession(); //save _GET $asParams = $_GET; unset($asParams[AnwActionPage::GET_PAGENAME]); //avoid loop //redirect $sLink = AnwUtils::link($oGoodPage, "view", $asParams); AnwUtils::redirect($sLink); } else { self::debug("redirectIfTranslationAvailable(" . $sLang . "): translation found but no permission"); } } else { self::debug("redirectIfTranslationAvailable(" . $sLang . "): translation NOT found"); } } }