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