disabled LOGINDISABLED check, when imap server is mapped with external
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 17 Apr 2005 12:28:42 +0000 (12:28 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 17 Apr 2005 12:28:42 +0000 (12:28 +0000)
function

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9327 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/login.php

index 90f16c3f9f86ce16977599606102db5a4acbf2ab..15f365cfee5bc9319d68e5fd9daa60cc15ae1773 100644 (file)
@@ -60,18 +60,24 @@ 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.").'<br />'.
-            _("Using CRAM-MD5 or DIGEST-MD5 authentication instead may work.").'<br />';
-        if (!$use_imap_tls) {
-            $string .= _("Also, the use of TLS may allow SquirrelMail to login.").'<br />';
+    /**
+     * 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.").'<br />'.
+                _("Using CRAM-MD5 or DIGEST-MD5 authentication instead may work.").'<br />';
+            if (!$use_imap_tls) {
+                $string .= _("Also, the use of TLS may allow SquirrelMail to login.").'<br />';
+            }
+            $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;
     }
 }