From c6d6fe73f0e01b1415594cf719e9f610cc66c38d Mon Sep 17 00:00:00 2001 From: gustavf Date: Wed, 5 Jul 2000 11:43:56 +0000 Subject: [PATCH] Fixed some problems with cookies bein set wrong when logging in/out. Now correctly clears cookies and resets session ID. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@590 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/login.php | 24 ++++++++++++++++++------ src/signout.php | 25 ++++++++++++++++--------- src/webmail.php | 5 +++-- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/src/login.php b/src/login.php index c053f480..09e3d6f0 100644 --- a/src/login.php +++ b/src/login.php @@ -1,15 +1,15 @@ "; echo ""; echo _("SquirrelMail Login"); diff --git a/src/signout.php b/src/signout.php index 2219f6af..e3275c4d 100644 --- a/src/signout.php +++ b/src/signout.php @@ -1,12 +1,16 @@ <?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"); @@ -14,6 +18,8 @@ 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("_")) { @@ -38,9 +44,10 @@ } } - 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> diff --git a/src/webmail.php b/src/webmail.php index 158c7c42..2bc1caaf 100644 --- a/src/webmail.php +++ b/src/webmail.php @@ -1,8 +1,9 @@ <?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 @@ -44,7 +45,7 @@ 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); -- 2.25.1