alecpl
2012-01-03 fdff34093d479f1a9cb98107b68eb9137278b181
- Move some checks into login() method


2 files modified
9 ■■■■■ changed files
index.php 3 ●●●● patch | view | raw | blame | history
program/include/rcmail.php 6 ●●●● patch | view | raw | blame | history
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
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)