mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
cs fix
This commit is contained in:
@@ -63,8 +63,10 @@ class User extends \Espo\Core\Controllers\Record
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getService('User')
|
||||
$this->getService('User')
|
||||
->changePassword($this->getUser()->id, $data->password, true, $data->currentPassword);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postActionChangePasswordByRequest($params, $data, $request)
|
||||
|
||||
@@ -89,8 +89,12 @@ class User extends Record implements
|
||||
}
|
||||
|
||||
public function changePassword(
|
||||
string $userId, string $password, bool $checkCurrentPassword = false, ?string $currentPassword = null
|
||||
) {
|
||||
string $userId,
|
||||
string $password,
|
||||
bool $checkCurrentPassword = false,
|
||||
?string $currentPassword = null
|
||||
): void {
|
||||
|
||||
$user = $this->getEntityManager()->getEntity('User', $userId);
|
||||
|
||||
if (!$user) {
|
||||
@@ -132,8 +136,6 @@ class User extends Record implements
|
||||
$user->set('password', $this->hashPassword($password));
|
||||
|
||||
$this->getEntityManager()->saveEntity($user);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkPasswordStrength(string $password): bool
|
||||
|
||||
Reference in New Issue
Block a user