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