summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/auth.inc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2016-08-02 14:49:25 +0930
committerPhil Davis <phil.davis@inf.org>2016-08-02 14:49:25 +0930
commit2b7d0520818248920ec88514fde2c9b86c2a70af (patch)
tree3ea8d6abb23ddbba4820a1f2f9a1ecd85a3a747e /src/etc/inc/auth.inc
parent236e6a54e9a93284ca170b68aa1188dfaa195c3d (diff)
downloadpfsense-2b7d0520818248920ec88514fde2c9b86c2a70af.zip
pfsense-2b7d0520818248920ec88514fde2c9b86c2a70af.tar.gz
Save widget settings per user
For users that have "custom settings" enabled, save the "tool" settings of their widgets on a per-user basis. User that do not have "custom settings" enabled will continue to use and save widget settings to/from the system-wide settings.
Diffstat (limited to 'src/etc/inc/auth.inc')
-rw-r--r--src/etc/inc/auth.inc13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/etc/inc/auth.inc b/src/etc/inc/auth.inc
index 2d83326..eb18765 100644
--- a/src/etc/inc/auth.inc
+++ b/src/etc/inc/auth.inc
@@ -1529,15 +1529,22 @@ function get_user_settings($username) {
return $settings;
}
-function save_widget_settings($username, $settings) {
+function save_widget_settings($username, $settings, $message = "") {
global $config, $userindex;
$user = getUserEntry($username);
+
+ if (strlen($message) > 0) {
+ $msgout = $message;
+ } else {
+ $msgout = gettext("Widget configuration has been changed.");
+ }
+
if (isset($user['customsettings'])) {
$config['system']['user'][$userindex[$username]]['widgets'] = $settings;
- write_config(sprintf(gettext("Widget configuration has been changed for user %s."), $username));
+ write_config($msgout . " " . sprintf(gettext("(User %s)"), $username));
} else {
$config['widgets'] = $settings;
- write_config(gettext("Widget configuration has been changed."));
+ write_config($msgout);
}
}
OpenPOWER on IntegriCloud