only generate salt and crypted_pw once

This commit is contained in:
Scott Ullrich 2005-10-04 00:21:46 +00:00
parent c2acdb73d8
commit f53c7cd0ab

View File

@ -1193,16 +1193,14 @@ function sync_webgui_passwords() {
global $config;
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);
/* sync root */
$fd = popen("/usr/sbin/pw usermod -n root -H 0", "w");
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");