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 | * |
4b4abf93 |
8 | * @copyright © 1999-2005 The SquirrelMail Project Team |
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 | /** |
15 | * Path for SquirrelMail required files. |
16 | * @ignore |
17 | */ |
86725763 |
18 | define('SM_PATH','../'); |
19 | |
46b0c6f4 |
20 | require_once(SM_PATH . 'include/validate.php'); |
21 | require_once(SM_PATH . 'functions/prefs.php'); |
86725763 |
22 | require_once(SM_PATH . 'functions/plugin.php'); |
23 | require_once(SM_PATH . 'functions/strings.php'); |
24 | require_once(SM_PATH . 'functions/html.php'); |
f740c049 |
25 | |
46b0c6f4 |
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); |
fb745cc7 |
34 | } |
32f4e318 |
35 | } |
36 | } |
288491a4 |
37 | |
32f4e318 |
38 | if (!isset($frame_top)) { |
fb745cc7 |
39 | $frame_top = '_top'; |
32f4e318 |
40 | } |
d03f3582 |
41 | |
32f4e318 |
42 | /* If a user hits reload on the last page, $base_uri isn't set |
43 | * because it was deleted with the session. */ |
f38b7cf0 |
44 | if (! sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) { |
45 | require_once(SM_PATH . 'functions/display_messages.php'); |
f3bc099d |
46 | $base_uri = sqm_baseuri(); |
32f4e318 |
47 | } |
e8bef7f4 |
48 | |
32f4e318 |
49 | do_hook('logout'); |
f923b93d |
50 | |
e8bef7f4 |
51 | sqsession_destroy(); |
52 | |
32f4e318 |
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 | } |
118eb9a4 |
58 | |
59 | /* internal gettext functions will fail, if language is not set */ |
60 | set_up_language($squirrelmail_language, true, true); |
21c3249f |
61 | ?> |
e8bef7f4 |
62 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
fab3baa6 |
63 | <html> |
e8bef7f4 |
64 | <head> |
59177427 |
65 | <?php |
32f4e318 |
66 | if ($theme_css != '') { |
8c65f339 |
67 | ?> |
3c621ba1 |
68 | <link rel="stylesheet" type="text/css" href="<?php echo $theme_css; ?>" /> |
8c65f339 |
69 | <?php |
32f4e318 |
70 | } |
21c3249f |
71 | ?> |
be2b5012 |
72 | <meta name="robots" content="noindex,nofollow"> |
8178e728 |
73 | <title><?php echo $org_title . ' - ' . _("Signout"); ?></title> |
fab3baa6 |
74 | </head> |
91e0dccc |
75 | <body text="<?php echo $color[8]; ?>" bgcolor="<?php echo $color[4]; ?>" |
3c621ba1 |
76 | link="<?php echo $color[7]; ?>" vlink="<?php echo $color[7]; ?>" |
77 | alink="<?php echo $color[7]; ?>"> |
78 | <br /><br /> |
d4651fa2 |
79 | <?php |
ed89e55b |
80 | $plugin_message = concat_hook_function('logout_above_text'); |
fab3baa6 |
81 | echo |
82 | html_tag( 'table', |
83 | html_tag( 'tr', |
ca52e31b |
84 | html_tag( 'th', _("Sign Out"), 'center' ) , |
a74103dd |
85 | '', $color[0] ) . |
ed89e55b |
86 | $plugin_message . |
fab3baa6 |
87 | html_tag( 'tr', |
88 | html_tag( 'td', _("You have been successfully signed out.") . |
3c621ba1 |
89 | '<br /><a href="login.php" target="' . $frame_top . '">' . |
90 | _("Click here to log back in.") . '</a><br />' , |
fab3baa6 |
91 | 'center' ) , |
a74103dd |
92 | '', $color[4] ) . |
fab3baa6 |
93 | html_tag( 'tr', |
3c621ba1 |
94 | html_tag( 'td', '<br />', 'center' ) , |
a74103dd |
95 | '', $color[0] ) , |
96 | 'center', $color[4], 'width="50%" cellpadding="2" cellspacing="0" border="0"' ) |
a2b193bc |
97 | |
fab3baa6 |
98 | ?> |
99 | </body> |
f8a1ed5a |
100 | </html> |