diff options
Diffstat (limited to 'etc/rc.initial.password')
-rwxr-xr-x | etc/rc.initial.password | 20 |
1 files changed, 11 insertions, 9 deletions
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 +?> |