Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Alec Pritchard
2022-03-09 10:40:56 +00:00
parent c1517f69d5
commit ec61f5c9ed
43 changed files with 571 additions and 715 deletions

View File

@ -31,6 +31,6 @@ class ResetPasswordService implements ServiceInterface
public function run()
{
$this->model->password = $this->password;
return (bool)$this->model->save(false, ['password_hash']);
return (bool)$this->model->save(false, ['password_hash','password_changed_at']);
}
}

View File

@ -57,7 +57,7 @@ class UserCreateService implements ServiceInterface
$model->confirmed_at = time();
$model->password = !empty($model->password)
? $model->password
: $this->securityHelper->generatePassword(8);
: $this->securityHelper->generatePassword(8, $this->getModule('user')->minPasswordRequirements);
/** @var UserEvent $event */
$event = $this->make(UserEvent::class, [$model]);
@ -87,6 +87,7 @@ class UserCreateService implements ServiceInterface
$model->addError('username', $error_msg);
}
$transaction->rollBack();
Yii::error($error_msg, 'usuario');
return false;
}
$transaction->commit();

View File

@ -51,7 +51,7 @@ class UserRegisterService implements ServiceInterface
try {
$model->confirmed_at = $this->getModule()->enableEmailConfirmation ? null : time();
$model->password = $this->getModule()->generatePasswords
? $this->securityHelper->generatePassword(8)
? $this->securityHelper->generatePassword(8, $this->getModule('user')->minPasswordRequirements)
: $model->password;
$event = $this->make(UserEvent::class, [$model]);