From 1e7fc1cbc36f95aa4d3b0437919e19a244f1b5ba Mon Sep 17 00:00:00 2001 From: tassium Date: Sat, 4 Jan 2003 06:21:06 +0000 Subject: [PATCH] Improved error handling, especially for everyone whose CVS install just broke because plain auth no longer exists. (Now renamed to login) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4377 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index bcf9b9f8..17c15a46 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -279,8 +279,13 @@ function sqimap_login ($username, $password, $imap_server_address, $imap_port, $ // Original IMAP login code $query = 'LOGIN "' . quoteIMAP($username) . '" "' . quoteIMAP($password) . '"'; $read = sqimap_run_command ($imap_stream, $query, false, $response, $message); - } else { - // Insert SASL PLAIN code here, if it ever gets implemented + } elseif ($imap_auth_mech == 'plain') { + /* Replace this with SASL PLAIN if it ever gets implemented */ + $response="BAD"; + $message='SquirrelMail does not support SASL PLAIN yet. Rerun conf.pl and use login instead.'; + } else { + $response="BAD"; + $message="Internal SquirrelMail error - unknown IMAP authentication method chosen. Please contact the developers."; } /* If the connection was not successful, lets see why */ @@ -296,8 +301,8 @@ function sqimap_login ($username, $password, $imap_server_address, $imap_port, $ } else { $string = sprintf (_("Unknown error: %s") . "
\n", $message); } - $string .= '
' . _("Read data:") . "
\n"; - if (is_array($read)) { + if (isset($read) && is_array($read)) { + $string .= '
' . _("Read data:") . "
\n"; foreach ($read as $line) { $string .= htmlspecialchars($line) . "
\n"; } -- 2.25.1