X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Flogin.php;h=7b541abaf2ffe1a1ebb9ede02305af80acf460ad;hb=4ecd3a703b4c3e74932811686ce21e94744745b8;hp=9a00a2d8786908168943cbfbc490e7001da4a3c4;hpb=03ff39b20a43a1fe07e71cd812988c76a290a3da;p=squirrelmail.git
diff --git a/src/login.php b/src/login.php
index 9a00a2d8..7b541aba 100644
--- a/src/login.php
+++ b/src/login.php
@@ -1,80 +1,186 @@
-
- /**
- ** 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 logins are disabled.
";
+ if (!$use_imap_tls) {
+ $string .= "The use of TLS may allow SquirrelMail to login.
";
+ }
+ $string .= "Please contact your system administrator.";
+ 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');
+echo "\n".
+ "