X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flogin.php;h=5cbe981e2f2012383216952cf4a7c9c59ad988b2;hb=3d806bf24c070fddf00bee07368c168b1c8543b6;hp=90f16c3f9f86ce16977599606102db5a4acbf2ab;hpb=8bc594ba755f1d42842f03a9b3b5ec551309e799;p=squirrelmail.git
diff --git a/src/login.php b/src/login.php
index 90f16c3f..5cbe981e 100644
--- a/src/login.php
+++ b/src/login.php
@@ -3,12 +3,11 @@
/**
* login.php -- simple login screen
*
- * Copyright (c) 1999-2005 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
* This a simple login screen. Some housekeeping is done to clean
* cookies and find language.
*
+ * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
*/
@@ -51,7 +50,13 @@ $base_uri = sqm_baseuri();
*/
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
+ */
+@sqsession_start();
header('Pragma: no-cache');
/**
@@ -60,26 +65,34 @@ header('Pragma: no-cache');
* explaining the situation.
*/
if($imap_auth_mech == 'login') {
- $imap = sqimap_create_stream($imapServerAddress, $imapPort, $use_imap_tls);
- $logindisabled = sqimap_capability($imap,'LOGINDISABLED');
- sqimap_logout($imap);
- if ($logindisabled) {
- $string = _("The IMAP server is reporting that plain text logins are disabled.").'
'.
- _("Using CRAM-MD5 or DIGEST-MD5 authentication instead may work.").'
';
- if (!$use_imap_tls) {
- $string .= _("Also, the use of TLS may allow SquirrelMail to login.").'
';
+ /**
+ * detect disabled login, only when imapServerAddress contains
+ * server address and not mapping. See sqimap_get_user_server()
+ */
+ if (substr($imapServerAddress, 0, 4) != "map:") {
+ $imap = sqimap_create_stream($imapServerAddress, $imapPort, $use_imap_tls);
+ $logindisabled = sqimap_capability($imap,'LOGINDISABLED');
+ sqimap_logout($imap);
+ if ($logindisabled) {
+ $string = _("The IMAP server is reporting that plain text logins are disabled.").'
'.
+ _("Using CRAM-MD5 or DIGEST-MD5 authentication instead may work.").'
';
+ if (!$use_imap_tls) {
+ $string .= _("Also, the use of TLS may allow SquirrelMail to login.").'
';
+ }
+ $string .= _("Please contact your system administrator and report this error.");
+ error_box($string,$color);
+ exit;
}
- $string .= _("Please contact your system administrator and report this error.");
- error_box($string,$color);
- exit;
}
}
do_hook('login_cookie');
+$loginname_value = (sqGetGlobalVar('loginname', $loginname) ? htmlspecialchars($loginname) : '');
+
/* Output the javascript onload function. */
-$header = "