X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Flogin.php;h=d3abfc28fd1477231eadacf438b6b470efa4a8e9;hp=e21cc3e67fc7df33bd2a6d9dc8f854f00193a974;hb=ebd2391cb0c5e3049870f90fa8a8b28707e9571a;hpb=602a123e5f75c57dace7d147cbe274b4230b7178 diff --git a/src/login.php b/src/login.php index e21cc3e6..d3abfc28 100644 --- a/src/login.php +++ b/src/login.php @@ -6,12 +6,15 @@ * This a simple login screen. Some housekeeping is done to clean * cookies and find language. * - * @copyright © 1999-2006 The SquirrelMail Project Team + * @copyright © 1999-2007 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail */ +/** This is the login page */ +define('PAGE_NAME', 'login'); + // reduces the files included in init.php $sInitLocation = 'login'; @@ -31,20 +34,24 @@ require_once(SM_PATH . 'functions/forms.php'); */ set_up_language($squirrelmail_language, TRUE, TRUE); -/* - * In case the last session was not terminated properly, make sure - * we get a new one. - */ -sqsession_destroy(); /** - * PHP bug. http://bugs.php.net/11643 (warning, spammed bug tracker) and - * http://bugs.php.net/13834 - * SID constant is not destroyed in PHP 4.1.2, 4.2.3 and maybe other - * versions. Produces warning on login page. Bug should be fixed only in 4.3.0 + * In case the last session was not terminated properly, make sure + * we get a new one, but make sure we preserve session_expired_* */ -@sqsession_is_active(); -$_SESSION=array(); - +if ( !empty($_SESSION['session_expired_post']) && !empty($_SESSION['session_expired_location']) ) { + $sep = $_SESSION['session_expired_post']; + $sel = $_SESSION['session_expired_location']; + + sqsession_destroy(); + @sqsession_is_active(); + $_SESSION=array(); + sqsession_register($sep, 'session_expired_post'); + sqsession_register($sel, 'session_expired_location'); +} else { + sqsession_destroy(); + @sqsession_is_active(); + $_SESSION=array(); +} /** * This detects if the IMAP server has logins disabled, and if so, @@ -75,10 +82,11 @@ if($imap_auth_mech == 'login') { } } -do_hook('login_cookie'); +do_hook('login_cookie', $null); $loginname_value = (sqGetGlobalVar('loginname', $loginname) ? htmlspecialchars($loginname) : ''); +//FIXME: should be part of the template, not the core! /* Output the javascript onload function. */ $header = "