X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsignout.php;h=55576058e743f66205c455b43d6ec10081642a4d;hb=8e530924279d64d4fda7263d18846c678fc308f3;hp=9439d60f79daf92f5351cc208d4dae7bec7db449;hpb=d3cdb279bd61b172926b51d41d09c8a691d6c347;p=squirrelmail.git diff --git a/src/signout.php b/src/signout.php index 9439d60f..55576058 100644 --- a/src/signout.php +++ b/src/signout.php @@ -1,44 +1,77 @@ - - -\n"; - echo "

"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo " Sign Out"; - echo "
"; - echo "
You have been successfully signed out.
"; - echo " Click here to log back in.

"; - echo "
"; - echo "
"; - echo "
"; -?> - - +purgeAttachments(); + } +} + +if (!isset($frame_top)) { + $frame_top = '_top'; +} + +/* If a user hits reload on the last page, $base_uri isn't set + * because it was deleted with the session. */ +if (! sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) { + $base_uri = sqm_baseuri(); +} + +do_hook('logout'); + +sqsession_destroy(); + +if ($signout_page) { + // Status 303 header is disabled. PHP fastcgi bug. See 1.91 changelog. + //header('Status: 303 See Other'); + header("Location: $signout_page"); + exit; /* we send no content if we're redirecting. */ +} + +/* After a reload of signout.php, $oTemplate might not exist anymore. + * Recover, so that we don't get all kinds of errors in that situation. */ +if ( !isset($oTemplate) || !is_object($oTemplate) ) { + require_once(SM_PATH . 'class/template/Template.class.php'); + $sTemplateID = Template::get_default_template_set(); + $icon_theme_path = !$use_icons ? NULL : Template::calculate_template_images_directory($sTemplateID); + $oTemplate = Template::construct_template($sTemplateID); + + // We want some variables to always be available to the template + $always_include = array('sTemplateID', 'icon_theme_path', 'javascript_on'); + foreach ($always_include as $var) { + $oTemplate->assign($var, (isset($$var) ? $$var : NULL)); + } +} + +// The error handler object is probably also not initialized on a refresh +$oErrorHandler = new ErrorHandler($oTemplate,'error_message.tpl'); + +/* internal gettext functions will fail, if language is not set */ +set_up_language($squirrelmail_language, true, true); + +displayHtmlHeader($org_title . ' - ' . _("Signout")); + +$oTemplate->assign('frame_top', $frame_top); + +$oTemplate->display('signout.tpl'); + +$oTemplate->display('footer.tpl');