Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user