prefer to use move_uploaded_file over rename, <quote who=""> indeed doesn't
[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-2005 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 */
18 define('SM_PATH','../');
19
20 require_once(SM_PATH . 'include/validate.php');
21 require_once(SM_PATH . 'functions/prefs.php');
22 require_once(SM_PATH . 'functions/plugin.php');
23 require_once(SM_PATH . 'functions/strings.php');
24 require_once(SM_PATH . 'functions/html.php');
25
26 /* Erase any lingering attachments */
27 sqgetGlobalVar('compose_messages', $compose_messages, SQ_SESSION);
28 foreach($compose_messages as $composeMessage) {
29 $composeMessage->purgeAttachments();
30 }
31
32 if (!isset($frame_top)) {
33 $frame_top = '_top';
34 }
35
36 /* If a user hits reload on the last page, $base_uri isn't set
37 * because it was deleted with the session. */
38 if (! sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) {
39 require_once(SM_PATH . 'functions/display_messages.php');
40 $base_uri = sqm_baseuri();
41 }
42
43 do_hook('logout');
44
45 sqsession_destroy();
46
47 if ($signout_page) {
48 header('Status: 303 See Other');
49 header("Location: $signout_page");
50 exit; /* we send no content if we're redirecting. */
51 }
52
53 /* internal gettext functions will fail, if language is not set */
54 set_up_language($squirrelmail_language, true, true);
55 ?>
56 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
57 <html>
58 <head>
59 <?php
60 if ($theme_css != '') {
61 ?>
62 <link rel="stylesheet" type="text/css" href="<?php echo $theme_css; ?>" />
63 <?php
64 }
65 ?>
66 <meta name="robots" content="noindex,nofollow">
67 <title><?php echo $org_title . ' - ' . _("Signout"); ?></title>
68 </head>
69 <body text="<?php echo $color[8]; ?>" bgcolor="<?php echo $color[4]; ?>"
70 link="<?php echo $color[7]; ?>" vlink="<?php echo $color[7]; ?>"
71 alink="<?php echo $color[7]; ?>">
72 <br /><br />
73 <?php
74 $plugin_message = concat_hook_function('logout_above_text');
75 echo
76 html_tag( 'table',
77 html_tag( 'tr',
78 html_tag( 'th', _("Sign Out"), 'center' ) ,
79 '', $color[0] ) .
80 $plugin_message .
81 html_tag( 'tr',
82 html_tag( 'td', _("You have been successfully signed out.") .
83 '<br /><a href="login.php" target="' . $frame_top . '">' .
84 _("Click here to log back in.") . '</a><br />' ,
85 'center' ) ,
86 '', $color[4] ) .
87 html_tag( 'tr',
88 html_tag( 'td', '<br />', 'center' ) ,
89 '', $color[0] ) ,
90 'center', $color[4], 'width="50%" cellpadding="2" cellspacing="0" border="0"' )
91
92 ?>
93 </body>
94 </html>