summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-01-03 09:56:19 +0000
committeralecpl <alec@alec.pl>2012-01-03 09:56:19 +0000
commitfdff34093d479f1a9cb98107b68eb9137278b181 (patch)
tree1b4bf795e7357de7e7c4caf6938811ab7fdcf974
parentcc75440de24b90028e2843598b2f62c664bfe4f5 (diff)
- Move some checks into login() method
-rw-r--r--index.php3
-rw-r--r--program/include/rcmail.php6
2 files changed, 6 insertions, 3 deletions
diff --git a/index.php b/index.php
index 6f761a4ee..a2d012cc3 100644
--- a/index.php
+++ b/index.php
@@ -97,8 +97,7 @@ if ($RCMAIL->task == 'login' && $RCMAIL->action == 'login') {
$OUTPUT->show_message("cookiesdisabled", 'warning');
}
else if ($auth['valid'] && !$auth['abort'] &&
- !empty($auth['host']) && !empty($auth['user']) &&
- $RCMAIL->login($auth['user'], $auth['pass'], $auth['host'])
+ $RCMAIL->login($auth['user'], $auth['pass'], $auth['host'])
) {
// create new session ID, don't destroy the current session
// it was destroyed already by $RCMAIL->kill_session() above
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index deaaabf54..fbf691a51 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -750,11 +750,15 @@ class rcmail
* @param string IMAP user name
* @param string IMAP password
* @param string IMAP host
+ *
* @return boolean True on success, False on failure
*/
function login($username, $pass, $host=NULL)
{
- $user = NULL;
+ if (empty($username)) {
+ return false;
+ }
+
$config = $this->config->all();
if (!$host)