<?php
/**
- ** login.php
+ ** login.php -- simple login screen
+ **
+ ** Copyright (c) 1999-2000 The SquirrelMail development team
+ ** Licensed under the GNU GPL. For full terms see the file COPYING.
**
- ** Very simple login screen that clears the cookie every time it's loaded
+ ** This a simple login screen. Some housekeeping is done to clean
+ ** cookies and find language.
**
**/
- setcookie("username", "", time(), "/");
- setcookie("key", "", time(), "/");
- setcookie("logged_in", 0, time(), "/");
-
if (!isset($config_php))
include("../config/config.php");
if (!isset($strings_php))
}
}
+ // Need the base URI to set the cookies. (Same code as in webmail.php)
+ ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
+ $base_uri = $regs[1];
+
+ setcookie("username", "", 0, $base_uri);
+ setcookie("key", "", 0, $base_uri);
+ setcookie("logged_in", 0, 0, $base_uri);
+
+ // In case the last session was not terminated properly, make sure
+ // we get a new one.
+ setcookie("PHPSESSID", "", 0, $base_uri);
+
echo "<HTML>";
echo "<HEAD><TITLE>";
echo _("SquirrelMail Login");
<?php
session_start();
- /**
- ** signout.php
- **
- ** Clears the cookie, and logs them out.
- **
- **/
+ /**
+ ** signout.php -- cleans up session and logs the user out
+ **
+ ** Copyright (c) 1999-2000 The SquirrelMail development team
+ ** Licensed under the GNU GPL. For full terms see the file COPYING.
+ **
+ ** Cleans up after the user. Resets cookies and terminates
+ ** session.
+ **
+ **/
include ("../src/load_prefs.php");
include("../functions/i18n.php");
if (!isset($prefs_php))
include ("../functions/prefs.php");
+ if (!isset($plugin_php))
+ include ("../functions/plugin.php");
// Quick Fix for Gettext in LogOut Screen
if (!function_exists("_")) {
}
}
- setcookie("username", "", time(), "/");
- setcookie("key", "", time(), "/");
- setcookie("logged_in", 0, time(), "/");
+ do_hook("logout");
+ setcookie("username", "", 0, $base_uri);
+ setcookie("key", "", 0, $base_uri);
+ setcookie("logged_in", "", 0, $base_uri);
session_destroy();
?>
<HTML>
<?php
+
/**
** webmail.php -- Displays the main frameset
**
- ** Copyright (c) 2000 The SquirrelMail development team
+ ** Copyright (c) 1999-2000 The SquirrelMail development team
** Licensed under the GNU GPL. For full terms see the file COPYING.
**
** This file generates the main frameset. The files that are
if (!isset($auth_php))
include ("../functions/auth.php");
- if (!session_is_registered("user_is_logged_in")) {
+ if (!session_is_registered("user_is_logged_in") || $logged_in != 1) {
do_hook ("login_before");
// verify that username and password are correct
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);