Ukrainian Language , Oleg Baranovsky
[squirrelmail.git] / src / signout.php
... / ...
CommitLineData
1<?php
2
3/**
4 * signout.php -- cleans up session and logs the user out
5 *
6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
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 */
13
14/* Path for SquirrelMail required files. */
15define('SM_PATH','../');
16
17/* SquirrelMail required files. */
18require_once(SM_PATH . 'include/validate.php');
19require_once(SM_PATH . 'functions/prefs.php');
20require_once(SM_PATH . 'functions/plugin.php');
21require_once(SM_PATH . 'functions/strings.php');
22require_once(SM_PATH . 'functions/html.php');
23
24/* Erase any lingering attachments */
25if (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 }
33 }
34}
35
36if (!isset($frame_top)) {
37 $frame_top = '_top';
38}
39
40/* If a user hits reload on the last page, $base_uri isn't set
41 * because it was deleted with the session. */
42if (!isset($_SESSION['base_uri'])) {
43 if (!function_exists('sqm_baseuri')){
44 require_once(SM_PATH . 'functions/display_messages.php');
45 }
46 $base_uri = sqm_baseuri();
47} else {
48 $base_uri = $_SESSION['base_uri'];
49}
50sqsession_destroy();
51do_hook('logout');
52
53if ($signout_page) {
54 header('Status: 303 See Other');
55 header("Location: $signout_page");
56 exit; /* we send no content if we're redirecting. */
57}
58?>
59<html>
60 <head>
61<?php
62 if ($theme_css != '') {
63?>
64<link rel="stylesheet" type="text/css" href="<?php echo $theme_css ?>">
65<?php
66 }
67?>
68<title><?php echo $org_title ?> - Signout</title>
69</head>
70<body text="<?php echo $color[8] ?>" bgcolor="<?php echo $color[4] ?>"
71link="<?php echo $color[7] ?>" vlink="<?php echo $color[7] ?>"
72alink="<?php echo $color[7] ?>">
73<br><br>
74<?
75do_hook('logout_above_text');
76echo
77html_tag( 'table',
78 html_tag( 'tr',
79 html_tag( 'th', _("Sign Out"), 'center' ) ,
80 '', $color[0], 'width="100%"' ) .
81 html_tag( 'tr',
82 html_tag( 'td', _("You have been successfully signed out.") .
83 '<br><a href="login.php" target="' . $frame_top . '">' .
84 _("Click here to log back in.") . '</a><br>' ,
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>
93</html>