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