summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include/main.inc
diff options
context:
space:
mode:
authorroundcube <roundcube@208e9e7b-5314-0410-a742-e7e81cd9613c>2005-10-22 14:17:25 +0000
committerroundcube <roundcube@208e9e7b-5314-0410-a742-e7e81cd9613c>2005-10-22 14:17:25 +0000
commit72f37242a073b367c5d5c0934d3253a1c962c504 (patch)
tree1d75d5cbec50d10ad8e308c2b98950e1ffe323ff /roundcubemail/program/include/main.inc
parent60a1f79f2cef8367f832abddfd83b447973209e7 (diff)
Patches for 20051021 release
git-svn-id: https://svn.roundcube.net/trunk@55 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/main.inc')
-rw-r--r--roundcubemail/program/include/main.inc18
1 files changed, 9 insertions, 9 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc
index f0df4ef65..7955aa870 100644
--- a/roundcubemail/program/include/main.inc
+++ b/roundcubemail/program/include/main.inc
@@ -253,6 +253,15 @@ function rcmail_login($user, $pass, $host=NULL)
if (!$host)
$host = $CONFIG['default_host'];
+ // parse $host URL
+ $a_host = parse_url($host);
+ if ($a_host['host'])
+ {
+ $host = $a_host['host'];
+ $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? TRUE : FALSE;
+ $imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $CONFIG['default_port']);
+ }
+
// query if user already registered
$sql_result = $DB->query(sprintf("SELECT user_id, username, language, preferences
FROM %s
@@ -269,15 +278,6 @@ function rcmail_login($user, $pass, $host=NULL)
$user = $sql_arr['username'];
}
- // parse $host URL
- $a_host = parse_url($host);
- if ($a_host['host'])
- {
- $host = $a_host['host'];
- $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? TRUE : FALSE;
- $imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $CONFIG['default_port']);
- }
-
// exit if IMAP login failed
if (!($imap_login = $IMAP->connect($host, $user, $pass, $imap_port, $imap_ssl)))
return FALSE;