diff options
author | Phil Davis <phil.davis@inf.org> | 2016-08-02 14:49:25 +0930 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2016-08-02 14:49:25 +0930 |
commit | 2b7d0520818248920ec88514fde2c9b86c2a70af (patch) | |
tree | 3ea8d6abb23ddbba4820a1f2f9a1ecd85a3a747e /src/etc/inc/auth.inc | |
parent | 236e6a54e9a93284ca170b68aa1188dfaa195c3d (diff) | |
download | pfsense-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.inc | 13 |
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); } } |