diff options
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | program/steps/settings/save_prefs.inc | 15 |
2 files changed, 12 insertions, 4 deletions
@@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Support 'abort' and 'result' response in 'preferences_save' hook, add error handling - Fix bug where some content would cause hang on html2text conversion (#1487863) - Improve space-stuffing handling in format=flowed messages (#1487861) - Fix bug where some dates would produce SQL error in MySQL (#1487856) diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index 64aeb5f81..92e2d8b9d 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -97,10 +97,10 @@ switch ($CURR_SECTION) break; } -$data = rcmail::get_instance()->plugins->exec_hook('preferences_save', +$plugin = rcmail::get_instance()->plugins->exec_hook('preferences_save', array('prefs' => $a_user_prefs, 'section' => $CURR_SECTION)); -$a_user_prefs = $data['prefs']; +$a_user_prefs = $plugin['prefs']; // don't override these parameters foreach ((array)$CONFIG['dont_override'] as $p) @@ -159,10 +159,17 @@ switch ($CURR_SECTION) break; } -if ($USER->save_prefs($a_user_prefs)) +// Save preferences +if (!$plugin['abort']) + $saved = $USER->save_prefs($a_user_prefs); +else + $saved = $plugin['result']; + +if ($saved) $OUTPUT->show_message('successfullysaved', 'confirmation'); +else + $OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving', 'error'); // display the form again rcmail_overwrite_action('edit-prefs'); - |