@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 'loginTrim' => ['login', 'trim'], |
63 | 63 | 'passwordValidate' => [ |
64 | 64 | 'password', |
65 | - function ($attribute) { |
|
65 | + function($attribute) { |
|
66 | 66 | if ($this->user === null || !PasswordHelper::validate($this->password, $this->user->password_hash)) { |
67 | 67 | $this->addError($attribute, Yii::t('yuncms', 'Invalid login or password')); |
68 | 68 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | ], |
71 | 71 | 'confirmationValidate' => [ |
72 | 72 | 'login', |
73 | - function ($attribute) { |
|
73 | + function($attribute) { |
|
74 | 74 | if ($this->user !== null) { |
75 | 75 | $confirmationRequired = $this->getSetting('enableConfirmation') && !$this->getSetting('enableUnconfirmedLogin'); |
76 | 76 | if ($confirmationRequired && !$this->user->isEmailConfirmed) { |
@@ -74,7 +74,7 @@ |
||
74 | 74 | ], |
75 | 75 | |
76 | 76 | 'registrationPolicyRequired' => ['registrationPolicy', 'required', 'skipOnEmpty' => false, 'requiredValue' => true, |
77 | - 'message' => Yii::t('yuncms', 'By registering you confirm that you accept the Service Agreement and Privacy Policy.'),], |
|
77 | + 'message' => Yii::t('yuncms', 'By registering you confirm that you accept the Service Agreement and Privacy Policy.'), ], |
|
78 | 78 | ]; |
79 | 79 | } |
80 | 80 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | 'emailRequired' => ['email', 'required'], |
66 | 66 | 'emailPattern' => ['email', 'email'], |
67 | 67 | 'emailExist' => ['email', 'exist', 'targetClass' => User::class, 'message' => Yii::t('yuncms', 'There is no user with this email address')], |
68 | - 'emailUnconfirmed' => ['email', function ($attribute) { |
|
68 | + 'emailUnconfirmed' => ['email', function($attribute) { |
|
69 | 69 | $this->user = User::findByEmail($this->email); |
70 | 70 | if ($this->user !== null && $this->getSetting('enableConfirmation') && !$this->user->isEmailConfirmed) { |
71 | 71 | $this->addError($attribute, Yii::t('yuncms', 'You need to confirm your email address.')); |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | { |
86 | 86 | if ($this->validate()) { |
87 | 87 | /** @var UserToken $token */ |
88 | - $token = new UserToken([ 'user_id' => $this->user->id, 'type' => UserToken::TYPE_RECOVERY]); |
|
88 | + $token = new UserToken(['user_id' => $this->user->id, 'type' => UserToken::TYPE_RECOVERY]); |
|
89 | 89 | $token->save(false); |
90 | - $this->sendMessage($this->user->email,Yii::t('yuncms', 'Complete password reset on {0}', Yii::$app->name),'recovery',['user' => $this->user, 'token' => $token]); |
|
90 | + $this->sendMessage($this->user->email, Yii::t('yuncms', 'Complete password reset on {0}', Yii::$app->name), 'recovery', ['user' => $this->user, 'token' => $token]); |
|
91 | 91 | Yii::$app->session->setFlash('info', Yii::t('yuncms', 'An email has been sent with instructions for resetting your password')); |
92 | 92 | return true; |
93 | 93 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'emailRequired' => ['email', 'required'], |
52 | 52 | 'emailPattern' => ['email', 'email'], |
53 | 53 | 'emailExist' => ['email', 'exist', 'targetClass' => User::class], |
54 | - 'emailConfirmed' => ['email', function () { |
|
54 | + 'emailConfirmed' => ['email', function() { |
|
55 | 55 | if ($this->user != null && $this->user->isEmailConfirmed) { |
56 | 56 | $this->addError('email', Yii::t('user', 'This account has already been confirmed')); |
57 | 57 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | /** @var UserToken $token */ |
91 | 91 | $token = new UserToken(['user_id' => $this->user->id, 'type' => UserToken::TYPE_CONFIRMATION]); |
92 | 92 | $token->save(false); |
93 | - $this->sendMessage($this->user->email,Yii::t('yuncms', 'Confirm account on {0}', Yii::$app->name),'confirmation',['user' => $this->user, 'token' => $token]); |
|
93 | + $this->sendMessage($this->user->email, Yii::t('yuncms', 'Confirm account on {0}', Yii::$app->name), 'confirmation', ['user' => $this->user, 'token' => $token]); |
|
94 | 94 | Yii::$app->session->setFlash('info', Yii::t('yuncms', 'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.')); |
95 | 95 | return true; |
96 | 96 | } |