diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-09-21 22:07:28 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-09-21 22:07:28 +0000 |
commit | 0d174c5f27b2fa8437021d47f576178083020343 (patch) | |
tree | 702a3212a4b266d0f55bbfeaa4208e7a7cd97998 /etc/inc | |
parent | bf091a775dbafa6b6360e6c0de6a7515ce4d16fe (diff) | |
download | pfsense-0d174c5f27b2fa8437021d47f576178083020343.zip pfsense-0d174c5f27b2fa8437021d47f576178083020343.tar.gz |
Sync admin account unconditionally.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/system.inc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 29f460e..5eca8f8 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -647,20 +647,31 @@ EOD; function system_password_configure() { global $config, $g; + conf_mount_rw(); + $fd = fopen("{$g['varrun_path']}/htpasswd", "w"); if (!$fd) { printf("Error: cannot open htpasswd in system_password_configure().\n"); return 1; } - if ($config['system']['username']) + /* set admin account */ + $username = "admin"; + fwrite($fd, $username . ":" . $config['system']['password'] . "\n"); + + /* set defined user account */ + if($username <> "admin") { $username = $config['system']['username']; - else - $username = "admin"; + fwrite($fd, $username . ":" . $config['system']['password'] . "\n"); + } - fwrite($fd, $username . ":" . $config['system']['password'] . "\n"); fclose($fd); - chmod("{$g['varrun_path']}/htpasswd", 0600); + chmod("{$g['varrun_path']}/htpasswd", 0600); + + /* sync passwords */ + sync_webgui_passwords(); + + /* !NOTE! conf_mount_ro is done by sync_webgui_passwords() */ return 0; } |