summaryrefslogtreecommitdiff
path: root/program/steps/settings/save_prefs.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/settings/save_prefs.inc')
-rw-r--r--program/steps/settings/save_prefs.inc15
1 files changed, 11 insertions, 4 deletions
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index feeb18341..2bf814722 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');
-