Compare commits

..

4 commits

Author SHA1 Message Date
Benjamin Renard
214545cfc2
DbObject: Fix return type of get & list methods 2024-09-19 10:38:47 +02:00
Benjamin Renard
18adcc4bb0
Auth\Db: replace add_user/edit_user CLI commands by user CLI command with subcommands 2024-09-19 09:57:42 +02:00
Benjamin Renard
7b2ce7ab73
Auth\Db: add edit_user CLI command 2024-09-15 10:01:13 +02:00
Benjamin Renard
bfac58c43a
Auth\Db: implement update_user() 2024-09-15 10:01:12 +02:00

View file

@ -228,7 +228,7 @@ class Db extends Backend {
} }
break; break;
case "password": case "password":
if (!self::check_password($user, $value)) if (!password_verify($value, $user["password"]))
$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, true)) { if (self :: update_user($user, $changes)) {
printf("User %s updated\n", $username); printf("User %s updated\n", $username);
return true; return true;
} }