mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
rc: finish root password reset; closes #1540
This commit is contained in:
parent
fb93a51c3b
commit
8f4acc30d0
@ -59,19 +59,29 @@ if (!$admin_user) {
|
||||
|
||||
$admin_user['name'] = 'root';
|
||||
$admin_user['scope'] = 'system';
|
||||
$admin_user['disabled'] = null;
|
||||
if (isset($admin_user['disabled'])) {
|
||||
unset($admin_user['disabled']);
|
||||
}
|
||||
|
||||
echo "\nType a new password: ";
|
||||
|
||||
shell_exec('/bin/stty -echo');
|
||||
$password = chop(fgets($fp));
|
||||
shell_exec('/bin/stty echo');
|
||||
echo "\n";
|
||||
if (empty($password)) {
|
||||
echo "\nPassword cannot be empty.\n";
|
||||
|
||||
return;
|
||||
}
|
||||
echo 'Confirm new password: ';
|
||||
|
||||
echo "Confirm new password: ";
|
||||
shell_exec('/bin/stty -echo');
|
||||
$confirm = chop(fgets($fp));
|
||||
shell_exec('/bin/stty echo');
|
||||
echo "\n";
|
||||
if ($password !== $confirm) {
|
||||
echo "\nPasswords do not match.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
local_user_set_password($admin_user, $password);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user