Adding template for error box.
[squirrelmail.git] / src / signout.php
... / ...
CommitLineData
1<?php
2
3/**
4 * signout.php -- cleans up session and logs the user out
5 *
6 * Cleans up after the user. Resets cookies and terminates session.
7 *
8 * @copyright &copy; 1999-2006 The SquirrelMail Project Team
9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 * @version $Id$
11 * @package squirrelmail
12 */
13
14/**
15 * Path for SquirrelMail required files.
16 * @ignore
17 */
18define('SM_PATH','../');
19
20include_once(SM_PATH . 'include/validate.php');
21require_once(SM_PATH . 'functions/prefs.php');
22require_once(SM_PATH . 'functions/plugin.php');
23require_once(SM_PATH . 'functions/strings.php');
24require_once(SM_PATH . 'functions/html.php');
25
26/* Erase any lingering attachments */
27sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION);
28
29if (!empty($compose_message) && is_array($compose_messages)) {
30 foreach($compose_messages as $composeMessage) {
31 $composeMessage->purgeAttachments();
32 }
33}
34
35if (!isset($frame_top)) {
36 $frame_top = '_top';
37}
38
39/* If a user hits reload on the last page, $base_uri isn't set
40 * because it was deleted with the session. */
41if (! sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) {
42 require_once(SM_PATH . 'functions/display_messages.php');
43 $base_uri = sqm_baseuri();
44}
45
46do_hook('logout');
47
48sqsession_destroy();
49
50if ($signout_page) {
51 header('Status: 303 See Other');
52 header("Location: $signout_page");
53 exit; /* we send no content if we're redirecting. */
54}
55
56/* internal gettext functions will fail, if language is not set */
57set_up_language($squirrelmail_language, true, true);
58?>
59<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
60 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
61<html>
62<head>
63<?php
64 if ($theme_css != '') {
65?>
66 <link rel="stylesheet" type="text/css" href="<?php echo $theme_css; ?>" />
67<?php
68 }
69?>
70 <meta name="robots" content="noindex,nofollow">
71 <title><?php echo $org_title . ' - ' . _("Signout"); ?></title>
72</head>
73<body text="<?php echo $color[8]; ?>" bgcolor="<?php echo $color[4]; ?>"
74link="<?php echo $color[7]; ?>" vlink="<?php echo $color[7]; ?>"
75alink="<?php echo $color[7]; ?>">
76<br /><br />
77<?php
78$plugin_message = concat_hook_function('logout_above_text');
79echo
80html_tag( 'table',
81 html_tag( 'tr',
82 html_tag( 'th', _("Sign Out"), 'center' ) ,
83 '', $color[0] ) .
84 $plugin_message .
85 html_tag( 'tr',
86 html_tag( 'td', _("You have been successfully signed out.") .
87 '<br /><a href="login.php" target="' . $frame_top . '">' .
88 _("Click here to log back in.") . '</a><br />' ,
89 'center' ) ,
90 '', $color[4] ) .
91 html_tag( 'tr',
92 html_tag( 'td', '<br />', 'center' ) ,
93 '', $color[0] ) ,
94'center', $color[4], 'width="50%" cellpadding="2" cellspacing="0" border="0"' );
95
96$oTemplate->display('footer.tpl');
97?>