diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2014-10-14 15:13:49 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2014-10-14 15:13:49 +0200 |
commit | b51de3279f579f53069a1aee49686102bce81166 (patch) | |
tree | f7c4daa1fb7580d0136e1ff6a011f4341fbd7ef8 | |
parent | 507dad3354b8d4f1e1c4e88561e08ae4d5b7e2fb (diff) |
Display custom error messages from plugins hooks (as documented in the API spec)
-rw-r--r-- | index.php | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -147,7 +147,7 @@ if ($RCMAIL->task == 'login' && $RCMAIL->action == 'login') { $error_code = RCMAIL::ERROR_INVALID_REQUEST; } else { - $error_code = $auth['error'] ? $auth['error'] : $RCMAIL->login_error(); + $error_code = is_numeric($auth['error']) ? $auth['error'] : $RCMAIL->login_error(); } $error_labels = array( @@ -157,7 +157,7 @@ if ($RCMAIL->task == 'login' && $RCMAIL->action == 'login') { RCMAIL::ERROR_INVALID_HOST => 'invalidhost', ); - $error_message = $error_labels[$error_code] ? $error_labels[$error_code] : 'loginfailed'; + $error_message = !is_numeric($auth['error']) ? $auth['error'] : ($error_labels[$error_code] ?: 'loginfailed'); $OUTPUT->show_message($error_message, 'warning'); |