6e5fc5183802da03d8a78a2ca074770cc3058ce2
[squirrelmail.git] / src / signout.php
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 * Include the SquirrelMail initialization file.
16 */
17 require('../include/init.php');
18
19 /* Erase any lingering attachments */
20 sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION);
21
22 if (!empty($compose_message) && is_array($compose_messages)) {
23 foreach($compose_messages as $composeMessage) {
24 $composeMessage->purgeAttachments();
25 }
26 }
27
28 if (!isset($frame_top)) {
29 $frame_top = '_top';
30 }
31
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();
36 }
37
38 do_hook('logout');
39
40 sqsession_destroy();
41
42 if ($signout_page) {
43 header('Status: 303 See Other');
44 header("Location: $signout_page");
45 exit; /* we send no content if we're redirecting. */
46 }
47
48 /* internal gettext functions will fail, if language is not set */
49 set_up_language($squirrelmail_language, true, true);
50 ?>
51 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
52 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
53 <html>
54 <head>
55 <?php
56 if ($theme_css != '') {
57 ?>
58 <link rel="stylesheet" type="text/css" href="<?php echo $theme_css; ?>" />
59 <?php
60 }
61 ?>
62 <meta name="robots" content="noindex,nofollow">
63 <title><?php echo $org_title . ' - ' . _("Signout"); ?></title>
64 </head>
65 <body text="<?php echo $color[8]; ?>" bgcolor="<?php echo $color[4]; ?>"
66 link="<?php echo $color[7]; ?>" vlink="<?php echo $color[7]; ?>"
67 alink="<?php echo $color[7]; ?>">
68 <br /><br />
69 <?php
70 $plugin_message = concat_hook_function('logout_above_text');
71 echo
72 html_tag( 'table',
73 html_tag( 'tr',
74 html_tag( 'th', _("Sign Out"), 'center' ) ,
75 '', $color[0] ) .
76 $plugin_message .
77 html_tag( 'tr',
78 html_tag( 'td', _("You have been successfully signed out.") .
79 '<br /><a href="login.php" target="' . $frame_top . '">' .
80 _("Click here to log back in.") . '</a><br />' ,
81 'center' ) ,
82 '', $color[4] ) .
83 html_tag( 'tr',
84 html_tag( 'td', '<br />', 'center' ) ,
85 '', $color[0] ) ,
86 'center', $color[4], 'width="50%" cellpadding="2" cellspacing="0" border="0"' );
87
88 $oTemplate->display('footer.tpl');
89 ?>