50d1172236a031020a96a8e3b6ac2fd3caa07a1b
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-2009 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_NAME', 'signout');
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 $login_uri = 'login.php';
37 do_hook('logout', $login_uri);
42 // Status 303 header is disabled. PHP fastcgi bug. See 1.91 changelog.
43 //header('Status: 303 See Other');
44 header("Location: $signout_page");
45 exit; /* we send no content if we're redirecting. */
48 /* After a reload of signout.php, $oTemplate might not exist anymore.
49 * Recover, so that we don't get all kinds of errors in that situation. */
50 if ( !isset($oTemplate) ||
!is_object($oTemplate) ) {
51 require_once(SM_PATH
. 'class/template/Template.class.php');
52 $sTemplateID = Template
::get_default_template_set();
53 $icon_theme_path = !$use_icons ?
NULL : Template
::calculate_template_images_directory($sTemplateID);
54 $oTemplate = Template
::construct_template($sTemplateID);
56 // We want some variables to always be available to the template
57 $oTemplate->assign('javascript_on', checkForJavascript());
58 $oTemplate->assign('base_uri', sqm_baseuri());
59 $always_include = array('sTemplateID', 'icon_theme_path');
60 foreach ($always_include as $var) {
61 $oTemplate->assign($var, (isset($
$var) ? $
$var : NULL));
65 // The error handler object is probably also not initialized on a refresh
66 $oErrorHandler = new ErrorHandler($oTemplate,'error_message.tpl');
68 /* internal gettext functions will fail, if language is not set */
69 set_up_language($squirrelmail_language, true, true);
71 displayHtmlHeader($org_title . ' - ' . _("Signout"));
73 $oTemplate->assign('frame_top', $frame_top);
74 $oTemplate->assign('login_uri', $login_uri);
76 $oTemplate->display('signout.tpl');
78 $oTemplate->display('footer.tpl');