diff --git a/Services/Init/classes/class.ilInitialisation.php b/Services/Init/classes/class.ilInitialisation.php index dc4442bb633c..12259dde2548 100644 --- a/Services/Init/classes/class.ilInitialisation.php +++ b/Services/Init/classes/class.ilInitialisation.php @@ -993,6 +993,7 @@ protected static function abortAndDie($a_message) { if (is_object($GLOBALS['ilLog'])) { $GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - " . $a_message); + $GLOBALS['ilLog']->logStack(); } die($a_message); } @@ -1821,7 +1822,8 @@ protected static function blockedAuthentication($a_current_script) if ( $cmd == "showTermsOfService" || $cmd == "showClientList" || $cmd == 'showAccountMigration' || $cmd == 'migrateAccount' || - $cmd == 'processCode' || $cmd == 'showLoginPage' || $cmd == 'doStandardAuthentication' || $cmd == 'doCasAuthentication' + $cmd == 'processCode' || $cmd == 'showLoginPage' || $cmd == 'showLogout' || + $cmd == 'doStandardAuthentication' || $cmd == 'doCasAuthentication' ) { ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmd: ' . $cmd); return true; diff --git a/Services/Init/classes/class.ilStartUpGUI.php b/Services/Init/classes/class.ilStartUpGUI.php index ee1691d79511..fdb21fd470a3 100755 --- a/Services/Init/classes/class.ilStartUpGUI.php +++ b/Services/Init/classes/class.ilStartUpGUI.php @@ -1242,16 +1242,58 @@ protected function doMigration() } } + /** + * Show logout screen + */ + protected function showLogout() + { + global $DIC; + + $lng = $DIC->language(); + $ilIliasIniFile = $DIC['ilIliasIniFile']; + + $tpl = self::initStartUpTemplate("tpl.logout.html"); + + $client_id = $_GET['client_id']; + + if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME'])) { + $tpl->setCurrentBlock("homelink"); + $tpl->setVariable("CLIENT_ID", "?client_id=" . $client_id . "&lang=" . $lng->getLangKey()); + $tpl->setVariable("TXT_HOME", $lng->txt("home")); + $tpl->parseCurrentBlock(); + } + + if ($ilIliasIniFile->readVariable("clients", "list")) { + $tpl->setCurrentBlock("client_list"); + $tpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list")); + $this->ctrl->setParameter($this, "client_id", $client_id); + $tpl->setVariable( + "CMD_CLIENT_LIST", + $this->ctrl->getLinkTarget($this, "showClientList") + ); + $tpl->parseCurrentBlock(); + $this->ctrl->setParameter($this, "client_id", ""); + } + + $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("logout")); + $tpl->setVariable("TXT_LOGOUT_TEXT", $lng->txt("logout_text")); + $tpl->setVariable("TXT_LOGIN", $lng->txt("login_to_ilias")); + $tpl->setVariable("CLIENT_ID", "?client_id=" . $client_id . "&lang=" . $lng->getLangKey()); + + self::printToGlobalTemplate($tpl); + } + /** * show logout screen */ - public function showLogout() + public function doLogout() { global $DIC; $ilSetting = $DIC->settings(); + $user = $DIC->user(); $lng = $DIC->language(); $ilIliasIniFile = $DIC['ilIliasIniFile']; $ilAppEventHandler = $DIC['ilAppEventHandler']; @@ -1264,6 +1306,8 @@ public function showLogout() ] ); + $user_language = $user->getLanguage(); + ilSession::setClosingContext(ilSession::SESSION_CLOSE_USER); $GLOBALS['DIC']['ilAuthSession']->logout(); @@ -1283,34 +1327,10 @@ public function showLogout() $this->ctrl->redirectToURL('saml.php?action=logout&logout_url=' . urlencode(ILIAS_HTTP_PATH . '/login.php')); } - //instantiate logout template - $tpl = self::initStartUpTemplate("tpl.logout.html"); - - if (ilPublicSectionSettings::getInstance()->isEnabledForDomain($_SERVER['SERVER_NAME'])) { - $tpl->setCurrentBlock("homelink"); - $tpl->setVariable("CLIENT_ID", "?client_id=" . $client_id . "&lang=" . $lng->getLangKey()); - $tpl->setVariable("TXT_HOME", $lng->txt("home")); - $tpl->parseCurrentBlock(); - } - - if ($ilIliasIniFile->readVariable("clients", "list")) { - $tpl->setCurrentBlock("client_list"); - $tpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list")); - $this->ctrl->setParameter($this, "client_id", $client_id); - $tpl->setVariable( - "CMD_CLIENT_LIST", - $this->ctrl->getLinkTarget($this, "showClientList") - ); - $tpl->parseCurrentBlock(); - $this->ctrl->setParameter($this, "client_id", ""); - } - - $tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("logout")); - $tpl->setVariable("TXT_LOGOUT_TEXT", $lng->txt("logout_text")); - $tpl->setVariable("TXT_LOGIN", $lng->txt("login_to_ilias")); - $tpl->setVariable("CLIENT_ID", "?client_id=" . $client_id . "&lang=" . $lng->getLangKey()); - - self::printToGlobalTemplate($tpl); + // redirect and show logout information + $this->ctrl->setParameter($this, 'client_id', $client_id); + $this->ctrl->setParameter($this, 'lang', $user_language); + $this->ctrl->redirect($this, 'showLogout'); } /** diff --git a/Services/User/Settings/classes/class.ilPersonalSettingsGUI.php b/Services/User/Settings/classes/class.ilPersonalSettingsGUI.php index 158c142f7b57..b728b88601cf 100755 --- a/Services/User/Settings/classes/class.ilPersonalSettingsGUI.php +++ b/Services/User/Settings/classes/class.ilPersonalSettingsGUI.php @@ -894,7 +894,7 @@ protected function deleteOwnAccountLogout() $ilUser->activateDeletionFlag(); - // see ilStartupGUI::showLogout() + // see ilStartupGUI::doLogout() ilSession::setClosingContext(ilSession::SESSION_CLOSE_USER); $GLOBALS['DIC']['ilAuthSession']->logout(); diff --git a/logout.php b/logout.php index a0815a117715..7fc89078252c 100755 --- a/logout.php +++ b/logout.php @@ -14,7 +14,7 @@ ilInitialisation::initILIAS(); $ilCtrl->initBaseClass("ilStartUpGUI"); -$ilCtrl->setCmd("showLogout"); +$ilCtrl->setCmd('doLogout'); $ilCtrl->callBaseClass(); $ilBench->save();