From f74ec578bd14fc6fe5a8b14e53579985019e0d94 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Wed, 31 Oct 2007 00:28:26 +0000 Subject: [PATCH] PAGE_NAME might not be defined in all plugins, which might cause a "not defined" error on session timeouts. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12748 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 2 ++ functions/auth.php | 29 +++++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d2f0922..c093b6ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -225,6 +225,8 @@ Version 1.5.2 - SVN - Added a "short_open_tag" configuration test. - Fixed outgoing messages to allow addresses such as "0@..." or "000@...", etc. (#1818398). + - PAGE_NAME might not be defined in all plugins, which might cause a + "not defined" error on session timeouts. Version 1.5.1 (branched on 2006-02-12) -------------------------------------- diff --git a/functions/auth.php b/functions/auth.php index b7d57452..ba8ff5d4 100644 --- a/functions/auth.php +++ b/functions/auth.php @@ -34,19 +34,24 @@ function sqauth_is_logged_in() { return true; } - // First we store some information in the new session to prevent - // information-loss. - $session_expired_post = $_POST; - $session_expired_location = PAGE_NAME; - if (!sqsession_is_registered('session_expired_post')) { - sqsession_register($session_expired_post,'session_expired_post'); - } - if (!sqsession_is_registered('session_expired_location')) { - sqsession_register($session_expired_location,'session_expired_location'); - } - session_write_close(); + // First we store some information in the new session to prevent + // information-loss. + $session_expired_post = $_POST; + if (defined('PAGE_NAME')) + $session_expired_location = PAGE_NAME; + else + $session_expired_location = ''; - return false; + if (!sqsession_is_registered('session_expired_post')) { + sqsession_register($session_expired_post,'session_expired_post'); + } + if (!sqsession_is_registered('session_expired_location')) { + sqsession_register($session_expired_location,'session_expired_location'); + } + + session_write_close(); + + return false; } /** -- 2.25.1