Browse Source

disabled LOGINDISABLED check, when imap server is mapped with external
function

tokul 20 năm trước cách đây
mục cha
commit
3ca9830d63
1 tập tin đã thay đổi với 17 bổ sung11 xóa
  1. 17 11
      src/login.php

+ 17 - 11
src/login.php

@@ -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;
     }
 }