Commit 8f4acc30 authored by Franco Fichtner's avatar Franco Fichtner

rc: finish root password reset; closes #1540

parent fb93a51c
...@@ -59,19 +59,29 @@ if (!$admin_user) { ...@@ -59,19 +59,29 @@ if (!$admin_user) {
$admin_user['name'] = 'root'; $admin_user['name'] = 'root';
$admin_user['scope'] = 'system'; $admin_user['scope'] = 'system';
$admin_user['disabled'] = null; if (isset($admin_user['disabled'])) {
unset($admin_user['disabled']);
}
echo "\nType a new password: "; echo "\nType a new password: ";
shell_exec('/bin/stty -echo');
$password = chop(fgets($fp)); $password = chop(fgets($fp));
shell_exec('/bin/stty echo');
echo "\n";
if (empty($password)) { if (empty($password)) {
echo "\nPassword cannot be empty.\n"; echo "\nPassword cannot be empty.\n";
return;
} }
echo 'Confirm new password: ';
echo "Confirm new password: ";
shell_exec('/bin/stty -echo');
$confirm = chop(fgets($fp)); $confirm = chop(fgets($fp));
shell_exec('/bin/stty echo');
echo "\n";
if ($password !== $confirm) { if ($password !== $confirm) {
echo "\nPasswords do not match.\n"; echo "\nPasswords do not match.\n";
return;
} }
local_user_set_password($admin_user, $password); local_user_set_password($admin_user, $password);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment