diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-11-09 13:21:02 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-11-09 13:21:02 +0000 |
| commit | 465f8b5097dc16b93015671385354a206f3228e2 (patch) | |
| tree | b77c8d17c9c606a5c3d708d8eec4a648af22ed71 /roundcubemail/index.php | |
| parent | 0002efbf67a3e53da53e5c7091439508649aab20 (diff) | |
- Handle situation when $IMAP object isn't initialized on log in
git-svn-id: https://svn.roundcube.net/trunk@4202 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/index.php')
| -rw-r--r-- | roundcubemail/index.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/roundcubemail/index.php b/roundcubemail/index.php index e87c9c958..f1e5ac1d0 100644 --- a/roundcubemail/index.php +++ b/roundcubemail/index.php @@ -118,9 +118,11 @@ if ($RCMAIL->task == 'login' && $RCMAIL->action == 'login') { $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(); } } |
