Squelch display of login form if server reports LOGINDISABLED and issue an error...
authortassium <tassium@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 22 Oct 2003 21:52:49 +0000 (21:52 +0000)
committertassium <tassium@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 22 Oct 2003 21:52:49 +0000 (21:52 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5999 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/login.php

index e18fd327ac17a5b94aab712996aef4103e64ea48..ac9b981590a03105eb5c9d36473fcf5caa144e53 100644 (file)
@@ -24,6 +24,7 @@ require_once(SM_PATH . 'functions/constants.php');
 require_once(SM_PATH . 'functions/page_header.php');
 require_once(SM_PATH . 'functions/html.php');
 require_once(SM_PATH . 'functions/global.php');
 require_once(SM_PATH . 'functions/page_header.php');
 require_once(SM_PATH . 'functions/html.php');
 require_once(SM_PATH . 'functions/global.php');
+require_once(SM_PATH . 'functions/imap_general.php');
 
 /*
  * $squirrelmail_language is set by a cookie when the user selects
 
 /*
  * $squirrelmail_language is set by a cookie when the user selects
@@ -48,6 +49,19 @@ sqsession_destroy();
  
 header('Pragma: no-cache');
 
  
 header('Pragma: no-cache');
 
+$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;
+}
+
 do_hook('login_cookie');
 
 /* Output the javascript onload function. */
 do_hook('login_cookie');
 
 /* Output the javascript onload function. */