summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/pfsense-utils.inc14
-rwxr-xr-xusr/local/www/system.php8
2 files changed, 14 insertions, 8 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 3987c99..135130f 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1191,6 +1191,20 @@ function reload_interfaces() {
******/
function sync_webgui_passwords() {
conf_mount_rw();
+ $config['system']['password'] = crypt($_POST['password']);
+ /* sync root */
+ $fd = popen("/usr/sbin/pw usermod -n root -H 0", "w");
+ $salt = md5(time());
+ $crypted_pw = crypt($_POST['password'],$salt);
+ fwrite($fd, $crypted_pw);
+ pclose($fd);
+ /* sync admin */
+ $fd = popen("/usr/sbin/pw usermod -n admin -H 0", "w");
+ $salt = md5(time());
+ $crypted_pw = crypt($_POST['password'],$salt);
+ fwrite($fd, $crypted_pw);
+ pclose($fd);
+ update_changedesc("password changed via webConfigurator");
mwexec("/usr/sbin/pwd_mkdb -d /etc/ /etc/master.passwd");
mwexec("/usr/sbin/pwd_mkdb /etc/master.passwd");
conf_mount_ro();
diff --git a/usr/local/www/system.php b/usr/local/www/system.php
index 01575bc..406affd 100755
--- a/usr/local/www/system.php
+++ b/usr/local/www/system.php
@@ -136,16 +136,8 @@ if ($_POST) {
$config['system']['dnsallowoverride'] = $_POST['dnsallowoverride'] ? true : false;
if ($_POST['password']) {
- conf_mount_rw();
- $config['system']['password'] = crypt($_POST['password']);
- $fd = popen("/usr/sbin/pw usermod -n root -H 0", "w");
- $salt = md5(time());
- $crypted_pw = crypt($_POST['password'],$salt);
- fwrite($fd, $crypted_pw);
- pclose($fd);
update_changedesc("password changed via webConfigurator");
sync_webgui_passwords();
- conf_mount_ro();
}
if ($changecount > 0)
OpenPOWER on IntegriCloud