From 2f1f7a123c805bfc57621635ef84da617ba7d95d Mon Sep 17 00:00:00 2001 From: kink Date: Sat, 26 Oct 2002 14:20:00 +0000 Subject: [PATCH] Move error checking up git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4030 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index 737390d6..8575e7eb 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -210,13 +210,6 @@ function sqimap_login ($username, $password, $imap_server_address, $imap_port, $ $imap_server_address = sqimap_get_user_server($imap_server_address, $username); $imap_stream = fsockopen ( $imap_server_address, $imap_port, $error_number, $error_string, 15); - if ( !$imap_stream ) { - return false; - } - $server_info = fgets ($imap_stream, 1024); - - /* Decrypt the password */ - $password = OneTimePadDecrypt($password, $onetimepad); /* Do some error correction */ if (!$imap_stream) { @@ -226,11 +219,16 @@ function sqimap_login ($username, $password, $imap_server_address, $imap_port, $ $string = sprintf (_("Error connecting to IMAP server: %s.") . "
\r\n", $imap_server_address) . "$error_number : $error_string
\r\n"; - error_box($string,$color); + logout_error($string,$color); } exit; } + $server_info = fgets ($imap_stream, 1024); + + /* Decrypt the password */ + $password = OneTimePadDecrypt($password, $onetimepad); + $query = 'LOGIN "' . quoteIMAP($username) . '" "' . quoteIMAP($password) . '"'; $read = sqimap_run_command ($imap_stream, $query, false, $response, $message); -- 2.25.1