diff options
author | alecpl <alec@alec.pl> | 2011-09-05 12:45:51 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-09-05 12:45:51 +0000 |
commit | 427e3a40239f1aebc35f2b36960e65fea9a100c9 (patch) | |
tree | 68fe890fb80f8a5c8d69ff40901d34ff854cc7a9 /program | |
parent | aecadcf4a24379f314152c39a40af693cbf78249 (diff) |
- Check for "Permission denied" string in IMAP error messages to display more appropriate message to the user
Diffstat (limited to 'program')
-rw-r--r-- | program/include/main.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index 7e85e01fb..100feb68b 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -1568,7 +1568,11 @@ function rcmail_display_server_error($fallback=null, $fallback_args=null) $RCMAIL->output->show_message('errorreadonly', 'error'); } else if ($err_code && ($err_str = $RCMAIL->imap->get_error_str())) { - $RCMAIL->output->show_message('servererrormsg', 'error', array('msg' => $err_str)); + // try to detect access rights problem and display appropriate message + if (stripos($err_str, 'Permission denied') !== false) + $RCMAIL->output->show_message('errornoperm', 'error'); + else + $RCMAIL->output->show_message('servererrormsg', 'error', array('msg' => $err_str)); } else if ($fallback) { $RCMAIL->output->show_message($fallback, 'error', $fallback_args); |