Permalink
Browse files

- Move some checks into login() method

  • Loading branch information...
1 parent cc75440 commit fdff34093d479f1a9cb98107b68eb9137278b181 @alecpl alecpl committed Jan 3, 2012
Showing with 6 additions and 3 deletions.
  1. +1 −2 index.php
  2. +5 −1 program/include/rcmail.php
View
@@ -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
@@ -750,11 +750,15 @@ public function session_configure()
* @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)

0 comments on commit fdff340

Please sign in to comment.