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