hash password when creating a new user

This commit is contained in:
Uwe Steinmann 2024-04-23 13:55:55 +02:00
parent 84443437a2
commit 6250a212b3

View File

@ -2056,7 +2056,7 @@ class RestapiController { /* {{{ */
$role = isset($params['role']) ? $params['role'] : null;
$roleid = $role == 'admin' ? SeedDMS_Core_User::role_admin : ($role == 'guest' ? SeedDMS_Core_User::role_guest : SeedDMS_Core_User::role_user);
$newAccount = $dms->addUser($userName, $password, $fullname, $email, $language, $theme, $comment, $roleid);
$newAccount = $dms->addUser($userName, seed_pass_hash($password), $fullname, $email, $language, $theme, $comment, $roleid);
if ($newAccount === false) {
return $response->withJson(array('success'=>false, 'message'=>'Account could not be created, maybe it already exists', 'data'=>''), 500);
}