diff options
author | NewEraCracker <neweracracker@gmail.com> | 2016-09-23 18:06:31 +0100 |
---|---|---|
committer | NewEraCracker <neweracracker@gmail.com> | 2016-10-12 11:34:30 +0100 |
commit | e01e164c82b299f6c0625eefe76fbf0d7708e7a6 (patch) | |
tree | 8427d65c7af56bd5ffbafae68e3b662d04ddeda7 | |
parent | 0a1daa734cf21e72fc1dcd1c992bc287d11666c4 (diff) | |
download | pfsense-e01e164c82b299f6c0625eefe76fbf0d7708e7a6.zip pfsense-e01e164c82b299f6c0625eefe76fbf0d7708e7a6.tar.gz |
Backport save_widget_settings with 3 arguments from RELENG_2_3
Commit 6f1410582412fe771f51bd8b67bcbb952da97db6 introduced code relying on this
-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 2c412a9..7dd03b9 100644 --- a/src/etc/inc/auth.inc +++ b/src/etc/inc/auth.inc @@ -1551,15 +1551,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); } } |