X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Flogin.php;h=28c0f24158ff854bf6d53f62530bffe13b916cd2;hb=99e400a4186ba63f7df2adc19dbcb14d6af4856e;hp=c6f4a10c6b986a853e5947464a8ec68c1cb0b986;hpb=175e7218bffd68523c8c32a7fae9bde6b5d5c952;p=squirrelmail.git
diff --git a/src/login.php b/src/login.php
index c6f4a10c..28c0f241 100644
--- a/src/login.php
+++ b/src/login.php
@@ -1,80 +1,189 @@
-
- /**
- ** login.php
- **
- ** Very simple login screen that clears the cookie every time it's loaded
- **
- **/
-
- setcookie("username", "", time(), "/");
- setcookie("key", "", time(), "/");
- setcookie("logged_in", 0, time(), "/");
-
- if (!isset($config_php))
- include("../config/config.php");
- if (!isset($strings_php))
- include("../functions/strings.php");
-
- // let's check to see if they compiled with gettext support
- if (!function_exists("_")) {
- function _($string) {
- return $string;
- }
- } else {
- // $squirrelmail_language is set by a cookie when the user selects
- // language
- if (isset($squirrelmail_language)) {
- if ($squirrelmail_language != "en") {
- putenv("LANG=".$squirrelmail_language);
- bindtextdomain("squirrelmail", "../locale/");
- textdomain("squirrelmail");
- }
- }
- }
-
- echo "";
- echo "
";
- echo _("SquirrelMail Login");
- echo "\n";
- echo "\n";
+\n";
- echo "\n";
- echo "";
- echo _("SquirrelMail version $version
By the SquirrelMail Development Team");
- echo "
\n";
- echo "\n";
- echo "\n";
-?>
-
-
+header('Pragma: no-cache');
+
+/**
+ * This detects if the IMAP server has logins disabled, and if so,
+ * squelches the display of the login form and puts up a message
+ * 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.").'
';
+ }
+ $string .= _("Please contact your system administrator and report this error.");
+ error_box($string,$color);
+ exit;
+ }
+}
+
+do_hook('login_cookie');
+/* Output the javascript onload function. */
+
+$header = "\n";
+
+if (@file_exists($theme[$theme_default]['PATH']))
+ @include ($theme[$theme_default]['PATH']);
+
+displayHtmlHeader( "$org_name - " . _("Login"), $header, FALSE );
+
+echo "" .
+ "\n" . '' . "\n";
+
+do_hook('login_bottom');
+?>
+