Remove obsolete UID support conf.pl code.
[squirrelmail.git] / src / login.php
index db45ed6d2daf46461b0a4bb73b3a0ce7d3a49ae2..7b541abaf2ffe1a1ebb9ede02305af80acf460ad 100644 (file)
@@ -55,17 +55,19 @@ header('Pragma: no-cache');
  * squelches the display of the login form and puts up a message
  * explaining the situation.
  */
-$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 logins are disabled.<br>";
-    if (!$use_imap_tls) {
-        $string .= "The use of TLS may allow SquirrelMail to login.<br>";
+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 logins are disabled.<br>";
+        if (!$use_imap_tls) {
+            $string .= "The use of TLS may allow SquirrelMail to login.<br>";
+        }
+        $string .= "Please contact your system administrator.";
+        error_box($string,$color);
+        exit;
     }
-    $string .= "Please contact your system administrator.";
-    error_box($string,$color);
-    exit;
 }
 
 do_hook('login_cookie');