alecpl
2010-11-09 6d99f995766d32e6074201b847adf3ce7e5b0dbf
- Handle situation when $IMAP object isn't initialized on log in


1 files modified
6 ■■■■■ changed files
index.php 6 ●●●●● patch | view | raw | blame | history
index.php
@@ -118,9 +118,11 @@
    $OUTPUT->redirect($redir);
  }
  else {
    $OUTPUT->show_message($IMAP->get_error_code() < -1 ? 'imaperror' : 'loginfailed', 'warning');
    $error_code = is_object($IMAP) ? $IMAP->get_error_code() : -1;
    $OUTPUT->show_message($error_code < -1 ? 'imaperror' : 'loginfailed', 'warning');
    $RCMAIL->plugins->exec_hook('login_failed', array(
      'code' => $IMAP->get_error_code(), 'host' => $auth['host'], 'user' => $auth['user']));
      'code' => $error_code, 'host' => $auth['host'], 'user' => $auth['user']));
    $RCMAIL->kill_session();
  }
}