From fdff34093d479f1a9cb98107b68eb9137278b181 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Tue, 03 Jan 2012 04:56:19 -0500
Subject: [PATCH] - Move some checks into login() method
---
index.php | 3 +--
program/include/rcmail.php | 6 +++++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/index.php b/index.php
index 6f761a4..a2d012c 100644
--- a/index.php
+++ b/index.php
@@ -97,8 +97,7 @@
$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 deaaabf..fbf691a 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -750,11 +750,15 @@
* @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)
--
Gitblit v1.9.1