4 * signout.php -- cleans up session and logs the user out
6 * Cleans up after the user. Resets cookies and terminates session.
8 * @copyright © 1999-2007 The SquirrelMail Project Team
9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
11 * @package squirrelmail
14 /** This is the signout page */
15 define('PAGE_SIGNOUT', 1);
18 * Include the SquirrelMail initialization file.
20 require('../include/init.php');
22 /* Erase any lingering attachments */
23 sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION
);
25 if (!empty($compose_message) && is_array($compose_messages)) {
26 foreach($compose_messages as $composeMessage) {
27 $composeMessage->purgeAttachments();
31 if (!isset($frame_top)) {
35 /* If a user hits reload on the last page, $base_uri isn't set
36 * because it was deleted with the session. */
37 if (! sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION
) ) {
38 $base_uri = sqm_baseuri();
41 $login_uri = 'login.php';
43 do_hook('logout', $login_uri);
48 // Status 303 header is disabled. PHP fastcgi bug. See 1.91 changelog.
49 //header('Status: 303 See Other');
50 header("Location: $signout_page");
51 exit; /* we send no content if we're redirecting. */
54 /* After a reload of signout.php, $oTemplate might not exist anymore.
55 * Recover, so that we don't get all kinds of errors in that situation. */
56 if ( !isset($oTemplate) ||
!is_object($oTemplate) ) {
57 require_once(SM_PATH
. 'class/template/Template.class.php');
58 $sTemplateID = Template
::get_default_template_set();
59 $icon_theme_path = !$use_icons ?
NULL : Template
::calculate_template_images_directory($sTemplateID);
60 $oTemplate = Template
::construct_template($sTemplateID);
62 // We want some variables to always be available to the template
63 $oTemplate->assign('javascript_on', checkForJavascript());
64 $oTemplate->assign('base_uri', sqm_baseuri());
65 $always_include = array('sTemplateID', 'icon_theme_path');
66 foreach ($always_include as $var) {
67 $oTemplate->assign($var, (isset($
$var) ? $
$var : NULL));
71 // The error handler object is probably also not initialized on a refresh
72 $oErrorHandler = new ErrorHandler($oTemplate,'error_message.tpl');
74 /* internal gettext functions will fail, if language is not set */
75 set_up_language($squirrelmail_language, true, true);
77 displayHtmlHeader($org_title . ' - ' . _("Signout"));
79 $oTemplate->assign('frame_top', $frame_top);
80 $oTemplate->assign('login_uri', $login_uri);
82 $oTemplate->display('signout.tpl');
84 $oTemplate->display('footer.tpl');