From 45ee90edb38f3c52a242d248468a992bf19f1c44 Mon Sep 17 00:00:00 2001 From: Matthew Grooms Date: Fri, 25 Jul 2008 02:28:31 +0000 Subject: Rewrite portions of the user manager to ensure data is properly synced to the system password and group databases. This is to provide better support for centralized user management when local account administration is preferred. I also took this opportunity to do some housekeeping. A lot of funtions that were only being used in one place or not at all were removed. The user page privelege checks were also simplified in preperation for future work in this area. --- etc/rc.initial.password | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'etc/rc.initial.password') diff --git a/etc/rc.initial.password b/etc/rc.initial.password index 6cf0228..64dd34e 100755 --- a/etc/rc.initial.password +++ b/etc/rc.initial.password @@ -41,12 +41,17 @@ The webConfigurator password will be reset to the default (which is "' . strtolo gettext('Do you want to proceed [y|n]?'); if (strcasecmp(chop(fgets($fp)), "y") == 0) { - $adminUserName = getUNIXRootName(); - setUserName($adminUserName, "admin"); - setUserPWD($adminUserName, strtolower($g['product_name'])); - write_config(gettext("password changed from console menu")); - system_password_configure(); + foreach ($config['system']['user'] as & $user) { + if (isset($user['uid']) && !$user['uid']) { + $user['name'] = "admin"; + set_local_user_password($user,strtolower($g['product_name'])); + set_local_user($user); + write_config(gettext("password changed from console menu")); + system_password_configure(); + break; + } + } echo "\n" . gettext(' The password for the webConfigurator has been reset and @@ -58,7 +63,4 @@ the default as soon as you have logged into the webConfigurator.') . "\n" . fgets($fp); } - - sync_webgui_passwords(); - -?> \ No newline at end of file +?> -- cgit v1.1