added safety checks for outdated config.php and
[squirrelmail.git] / src / signout.php
CommitLineData
59177427 1<?php
895905c0 2
35586184 3/**
4 * signout.php -- cleans up session and logs the user out
5 *
35586184 6 * Cleans up after the user. Resets cookies and terminates session.
7 *
47ccfad4 8 * @copyright &copy; 1999-2006 The SquirrelMail Project Team
4b4abf93 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
30967a1e 10 * @version $Id$
8f6f9ba5 11 * @package squirrelmail
35586184 12 */
8b522a59 13
30967a1e 14/**
202bcbcc 15 * Include the SquirrelMail initialization file.
30967a1e 16 */
202bcbcc 17require('../include/init.php');
f740c049 18
46b0c6f4 19/* Erase any lingering attachments */
c077ffeb 20sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION);
f9b9ca12 21
22if (!empty($compose_message) && is_array($compose_messages)) {
23 foreach($compose_messages as $composeMessage) {
24 $composeMessage->purgeAttachments();
25 }
32f4e318 26}
288491a4 27
32f4e318 28if (!isset($frame_top)) {
fb745cc7 29 $frame_top = '_top';
32f4e318 30}
d03f3582 31
32f4e318 32/* If a user hits reload on the last page, $base_uri isn't set
33 * because it was deleted with the session. */
f38b7cf0 34if (! sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) {
f3bc099d 35 $base_uri = sqm_baseuri();
32f4e318 36}
e8bef7f4 37
32f4e318 38do_hook('logout');
f923b93d 39
e8bef7f4 40sqsession_destroy();
41
32f4e318 42if ($signout_page) {
29d387e7 43 // Status 303 header is disabled. PHP fastcgi bug. See 1.91 changelog.
44 //header('Status: 303 See Other');
32f4e318 45 header("Location: $signout_page");
46 exit; /* we send no content if we're redirecting. */
47}
118eb9a4 48
49/* internal gettext functions will fail, if language is not set */
50set_up_language($squirrelmail_language, true, true);
21c3249f 51?>
151562a7 52<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
53 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
fab3baa6 54<html>
e8bef7f4 55<head>
59177427 56<?php
32f4e318 57 if ($theme_css != '') {
8c65f339 58?>
3c621ba1 59 <link rel="stylesheet" type="text/css" href="<?php echo $theme_css; ?>" />
8c65f339 60<?php
32f4e318 61 }
21c3249f 62?>
be2b5012 63 <meta name="robots" content="noindex,nofollow">
8178e728 64 <title><?php echo $org_title . ' - ' . _("Signout"); ?></title>
fab3baa6 65</head>
91e0dccc 66<body text="<?php echo $color[8]; ?>" bgcolor="<?php echo $color[4]; ?>"
3c621ba1 67link="<?php echo $color[7]; ?>" vlink="<?php echo $color[7]; ?>"
68alink="<?php echo $color[7]; ?>">
69<br /><br />
d4651fa2 70<?php
ed89e55b 71$plugin_message = concat_hook_function('logout_above_text');
fab3baa6 72echo
73html_tag( 'table',
74 html_tag( 'tr',
ca52e31b 75 html_tag( 'th', _("Sign Out"), 'center' ) ,
a74103dd 76 '', $color[0] ) .
ed89e55b 77 $plugin_message .
fab3baa6 78 html_tag( 'tr',
79 html_tag( 'td', _("You have been successfully signed out.") .
3c621ba1 80 '<br /><a href="login.php" target="' . $frame_top . '">' .
81 _("Click here to log back in.") . '</a><br />' ,
fab3baa6 82 'center' ) ,
a74103dd 83 '', $color[4] ) .
fab3baa6 84 html_tag( 'tr',
3c621ba1 85 html_tag( 'td', '<br />', 'center' ) ,
a74103dd 86 '', $color[0] ) ,
a73a2136 87'center', $color[4], 'width="50%" cellpadding="2" cellspacing="0" border="0"' );
a2b193bc 88
af48f48c 89/* After a reload of signout.php, $oTemplate might not exist anymore.
90 * Recover, so that we don't get all kinds of errors in that situation. */
91if ( !isset($oTemplate) || !is_object($oTemplate) ) {
92 require_once(SM_PATH . 'class/template/template.class.php');
93 $aTemplateSet = ( !isset($aTemplateSet) ? array() : $aTemplateSet );
94 $templateset_default = ( !isset($templateset_default) ? 0 : $templateset_default );
95
96 $sTplDir = ( !isset($aTemplateSet[$templateset_default]['PATH']) ?
97 SM_PATH . 'templates/default/' :
98 $aTemplateSet[$templateset_default]['PATH'] );
99 $oTemplate = new Template($sTplDir);
100}
101
5c4ff7bf 102$oTemplate->display('footer.tpl');
af48f48c 103
a73a2136 104?>