X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Flogin.php;h=88b43680bd0a04fe907185a92495ff2fccc650c7;hb=87745b9cf4c1ea33c3788ab0c3a554e9574ec5d7;hp=4f0e7aea22a16beb5a55b125028e047a646a4fc7;hpb=895905c0f766ea03e85deab260b4bb1522dd0e3c;p=squirrelmail.git
diff --git a/src/login.php b/src/login.php
index 4f0e7aea..88b43680 100644
--- a/src/login.php
+++ b/src/login.php
@@ -1,150 +1,207 @@
$v) {
- $key = strtolower($k);
- $value = urlencode($v);
- if ($key == 'cc') {
- $rcptaddress .= '&send_to_cc=' . $value;
- } else if ($key == 'bcc') {
- $rcptaddress .= '&send_to_bcc=' . $value;
- } else if ($key == 'subject') {
- $rcptaddress .= '&subject=' . $value;
- } else if ($key == 'body') {
- $rcptaddress .= '&body=' . $value;
+ * 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.").'
'.
+ _("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;
}
-
- /* Double-encode in this fashion to get past redirect.php properly. */
- $rcptaddress = urlencode($rcptaddress);
}
+}
+
+do_hook('login_cookie');
+
+$loginname_value = (sqGetGlobalVar('loginname', $loginname) ? htmlspecialchars($loginname) : '');
+
+/* Output the javascript onload function. */
+
+$header = "\n";
+
+if (@file_exists($theme[$theme_default]['PATH']))
+ @include ($theme[$theme_default]['PATH']);
+
+if (! isset($color) || ! is_array($color)) {
+ // Add default color theme, if theme loading fails
+ $color = array();
+ $color[0] = '#dcdcdc'; /* light gray TitleBar */
+ $color[1] = '#800000'; /* red */
+ $color[2] = '#cc0000'; /* light red Warning/Error Messages */
+ $color[4] = '#ffffff'; /* white Normal Background */
+ $color[7] = '#0000cc'; /* blue Links */
+ $color[8] = '#000000'; /* black Normal text */
+}
+
+displayHtmlHeader( "$org_name - " . _("Login"), $header, FALSE );
+
+echo "