59177427 |
1 | <?php |
895905c0 |
2 | |
35586184 |
3 | /** |
4 | * signout.php -- cleans up session and logs the user out |
5 | * |
76911253 |
6 | * Copyright (c) 1999-2003 The SquirrelMail Project Team |
35586184 |
7 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
8 | * |
9 | * Cleans up after the user. Resets cookies and terminates session. |
10 | * |
11 | * $Id$ |
12 | */ |
8b522a59 |
13 | |
86725763 |
14 | /* Path for SquirrelMail required files. */ |
15 | define('SM_PATH','../'); |
16 | |
17 | /* SquirrelMail required files. */ |
08185f2a |
18 | require_once(SM_PATH . 'include/validate.php'); |
86725763 |
19 | require_once(SM_PATH . 'functions/prefs.php'); |
20 | require_once(SM_PATH . 'functions/plugin.php'); |
21 | require_once(SM_PATH . 'functions/strings.php'); |
22 | require_once(SM_PATH . 'functions/html.php'); |
f740c049 |
23 | |
32f4e318 |
24 | /* Erase any lingering attachments */ |
fb745cc7 |
25 | if (isset($attachments) && is_array($attachments) |
26 | && sizeof($attachments)){ |
27 | $hashed_attachment_dir = getHashedDir($username, $attachment_dir); |
28 | foreach ($attachments as $info) { |
29 | $attached_file = "$hashed_attachment_dir/$info[localfilename]"; |
30 | if (file_exists($attached_file)) { |
31 | unlink($attached_file); |
32 | } |
32f4e318 |
33 | } |
34 | } |
288491a4 |
35 | |
32f4e318 |
36 | if (!isset($frame_top)) { |
fb745cc7 |
37 | $frame_top = '_top'; |
32f4e318 |
38 | } |
d03f3582 |
39 | |
32f4e318 |
40 | /* If a user hits reload on the last page, $base_uri isn't set |
41 | * because it was deleted with the session. */ |
f38b7cf0 |
42 | if (! sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION) ) { |
43 | require_once(SM_PATH . 'functions/display_messages.php'); |
f3bc099d |
44 | $base_uri = sqm_baseuri(); |
32f4e318 |
45 | } |
e8bef7f4 |
46 | |
32f4e318 |
47 | do_hook('logout'); |
f923b93d |
48 | |
e8bef7f4 |
49 | sqsession_destroy(); |
50 | |
32f4e318 |
51 | if ($signout_page) { |
52 | header('Status: 303 See Other'); |
53 | header("Location: $signout_page"); |
54 | exit; /* we send no content if we're redirecting. */ |
55 | } |
21c3249f |
56 | ?> |
e8bef7f4 |
57 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
fab3baa6 |
58 | <html> |
e8bef7f4 |
59 | <head> |
59177427 |
60 | <?php |
32f4e318 |
61 | if ($theme_css != '') { |
8c65f339 |
62 | ?> |
d68323ff |
63 | <link rel="stylesheet" type="text/css" href="<?php echo $theme_css ?>" /> |
8c65f339 |
64 | <?php |
32f4e318 |
65 | } |
21c3249f |
66 | ?> |
e8bef7f4 |
67 | <title><?php echo $org_title ?> - Signout</title> |
fab3baa6 |
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> |
d4651fa2 |
73 | <?php |
ed89e55b |
74 | $plugin_message = concat_hook_function('logout_above_text'); |
fab3baa6 |
75 | echo |
76 | html_tag( 'table', |
77 | html_tag( 'tr', |
ca52e31b |
78 | html_tag( 'th', _("Sign Out"), 'center' ) , |
fab3baa6 |
79 | '', $color[0], 'width="100%"' ) . |
ed89e55b |
80 | $plugin_message . |
fab3baa6 |
81 | html_tag( 'tr', |
82 | html_tag( 'td', _("You have been successfully signed out.") . |
4a6bbb49 |
83 | '<br><a href="login.php" target="' . $frame_top . '">' . |
ca52e31b |
84 | _("Click here to log back in.") . '</a><br>' , |
fab3baa6 |
85 | 'center' ) , |
86 | '', $color[4], 'width="100%"' ) . |
87 | html_tag( 'tr', |
88 | html_tag( 'td', '<br>', 'center' ) , |
89 | '', $color[0], 'width="100%"' ) , |
90 | 'center', $color[4], 'width="50%" cols="1" cellpadding="2" cellspacing="0" border="0"' ) |
91 | ?> |
92 | </body> |
86725763 |
93 | </html> |