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-2006 The SquirrelMail Project Team
9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
11 * @package squirrelmail
15 * Include the SquirrelMail initialization file.
17 require('../include/init.php');
19 /* Erase any lingering attachments */
20 sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION
);
22 if (!empty($compose_message) && is_array($compose_messages)) {
23 foreach($compose_messages as $composeMessage) {
24 $composeMessage->purgeAttachments();
28 if (!isset($frame_top)) {
32 /* If a user hits reload on the last page, $base_uri isn't set
33 * because it was deleted with the session. */
34 if (! sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION
) ) {
35 $base_uri = sqm_baseuri();
43 // Status 303 header is disabled. PHP fastcgi bug. See 1.91 changelog.
44 //header('Status: 303 See Other');
45 header("Location: $signout_page");
46 exit; /* we send no content if we're redirecting. */
49 /* After a reload of signout.php, $oTemplate might not exist anymore.
50 * Recover, so that we don't get all kinds of errors in that situation. */
51 if ( !isset($oTemplate) ||
!is_object($oTemplate) ) {
52 require_once(SM_PATH
. 'class/template/template.class.php');
53 $aTemplateSet = ( !isset($aTemplateSet) ?
array() : $aTemplateSet );
54 $templateset_default = ( !isset($templateset_default) ?
0 : $templateset_default );
56 $sTplDir = !isset($aTemplateSet[$templateset_default]['PATH']) ? SM_PATH
. 'templates/default/' : $aTemplateSet[$templateset_default]['PATH'];
57 $icon_theme_path = !$use_icons ?
NULL : $sTplDir . 'images/';
58 $oTemplate = new Template($sTplDir);
60 // We want some variables to always be available to the template
61 $always_include = array('sTplDir', 'icon_theme_path');
62 foreach ($always_include as $var) {
63 $oTemplate->assign($var, (isset($
$var) ? $
$var : NULL));
67 // The error handler object is probably also not initialized on a refresh
68 require(SM_PATH
. 'class/error.class.php');
69 $oErrorHandler = new ErrorHandler($oTemplate,'error_message.tpl');
71 /* internal gettext functions will fail, if language is not set */
72 set_up_language($squirrelmail_language, true, true);
74 displayHtmlHeader($org_title . ' - ' . _("Signout"));
76 $oTemplate->assign('frame_top', $frame_top);
78 $oTemplate->display('signout.tpl');
80 $oTemplate->display('footer.tpl');