support for viewing headers of message/rfc822 attachments
[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 *
15e6162e 6 * Copyright (c) 1999-2002 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
35586184 14require_once('../src/validate.php');
15require_once('../functions/prefs.php');
16require_once('../functions/plugin.php');
46d38f78 17require_once('../functions/strings.php');
fab3baa6 18require_once('../functions/html.php');
f740c049 19
32f4e318 20/* Erase any lingering attachments */
fb745cc7 21if (isset($attachments) && is_array($attachments)
22 && sizeof($attachments)){
23 $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
24 foreach ($attachments as $info) {
25 $attached_file = "$hashed_attachment_dir/$info[localfilename]";
26 if (file_exists($attached_file)) {
27 unlink($attached_file);
28 }
32f4e318 29 }
30}
288491a4 31
32f4e318 32if (!isset($frame_top)) {
fb745cc7 33 $frame_top = '_top';
32f4e318 34}
d03f3582 35
32f4e318 36/* If a user hits reload on the last page, $base_uri isn't set
37 * because it was deleted with the session. */
85b454a0 38if (!isset($base_uri)) {
f3bc099d 39 if (!function_exists('sqm_baseuri')){
40 require_once('../functions/display_messages.php');
41 }
42 $base_uri = sqm_baseuri();
32f4e318 43}
ceac7a2f 44
32f4e318 45do_hook('logout');
46setcookie('username', '', 0, $base_uri);
47setcookie('key', '', 0, $base_uri);
48session_destroy();
f923b93d 49
32f4e318 50if ($signout_page) {
51 header('Status: 303 See Other');
52 header("Location: $signout_page");
53 exit; /* we send no content if we're redirecting. */
54}
21c3249f 55?>
fab3baa6 56<html>
57 <head>
59177427 58<?php
32f4e318 59 if ($theme_css != '') {
8c65f339 60?>
fab3baa6 61<link rel="stylesheet" type="text/css" href="<?php echo $theme_css ?>">
8c65f339 62<?php
32f4e318 63 }
21c3249f 64?>
fab3baa6 65<title><?php echo $org_title ?> - Signout</title>
66</head>
67<body text="<?php echo $color[8] ?>" bgcolor="<?php echo $color[4] ?>"
68link="<?php echo $color[7] ?>" vlink="<?php echo $color[7] ?>"
69alink="<?php echo $color[7] ?>">
70<br><br>
71<?
72do_hook('logout_above_text');
73echo
74html_tag( 'table',
75 html_tag( 'tr',
ca52e31b 76 html_tag( 'th', _("Sign Out"), 'center' ) ,
fab3baa6 77 '', $color[0], 'width="100%"' ) .
78 html_tag( 'tr',
79 html_tag( 'td', _("You have been successfully signed out.") .
ca52e31b 80 '<br><a href="login.php" target="' . $frame_to . '">' .
81 _("Click here to log back in.") . '</a><br>' ,
fab3baa6 82 'center' ) ,
83 '', $color[4], 'width="100%"' ) .
84 html_tag( 'tr',
85 html_tag( 'td', '<br>', 'center' ) ,
86 '', $color[0], 'width="100%"' ) ,
87'center', $color[4], 'width="50%" cols="1" cellpadding="2" cellspacing="0" border="0"' )
88?>
89</body>
90</html>