Compare commits

..

4 commits

Author SHA1 Message Date
Benjamin Renard
5e7bdb1d3d
DbObject: Fix return type of get & list methods 2024-09-19 19:33:48 +02:00
Benjamin Renard
e6f3fc835e
Auth\Db: replace add_user/edit_user CLI commands by user CLI command with subcommands 2024-09-19 19:33:47 +02:00
Benjamin Renard
74dc4bb608
Auth\Db: add edit_user CLI command 2024-09-19 19:32:53 +02:00
Benjamin Renard
0b84060f2c
Auth\Db: implement update_user() 2024-09-19 19:32:52 +02:00

View file

@ -228,7 +228,7 @@ class Db extends Backend {
} }
break; break;
case "password": case "password":
if (!password_verify($value, $user["password"])) if (!self::check_password($user, $value))
$values[self :: $password_field] = password_hash( $values[self :: $password_field] = password_hash(
$value, $value,
constant('PASSWORD_'.strtoupper(App::get('auth.db.password_hash_algo'))) constant('PASSWORD_'.strtoupper(App::get('auth.db.password_hash_algo')))
@ -387,7 +387,7 @@ class Db extends Backend {
print("No change.\n"); print("No change.\n");
return true; return true;
} }
if (self :: update_user($user, $changes)) { if (self :: update_user($user, $changes, true)) {
printf("User %s updated\n", $username); printf("User %s updated\n", $username);
return true; return true;
} }