|
|
@ -104,18 +104,18 @@ class User extends ActiveRecord implements IdentityInterface |
|
|
|
public function rules() |
|
|
|
public function rules() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return [ |
|
|
|
return [ |
|
|
|
[['username'], 'filter', 'filter' => 'trim'], |
|
|
|
['username', 'filter', 'filter' => 'trim'], |
|
|
|
[['username'], 'required'], |
|
|
|
['username', 'required'], |
|
|
|
[['username'], 'string', 'min' => 2, 'max' => 255], |
|
|
|
['username', 'string', 'min' => 2, 'max' => 255], |
|
|
|
|
|
|
|
|
|
|
|
[['email'], 'filter', 'filter' => 'trim'], |
|
|
|
['email', 'filter', 'filter' => 'trim'], |
|
|
|
[['email'], 'required'], |
|
|
|
['email', 'required'], |
|
|
|
[['email'], 'email'], |
|
|
|
['email', 'email'], |
|
|
|
[['email'], 'unique', 'message' => 'This email address has already been taken.', 'on' => 'signup'], |
|
|
|
['email', 'unique', 'message' => 'This email address has already been taken.', 'on' => 'signup'], |
|
|
|
[['email'], 'exist', 'message' => 'There is no user with such email.', 'on' => 'requestPasswordResetToken'], |
|
|
|
['email', 'exist', 'message' => 'There is no user with such email.', 'on' => 'requestPasswordResetToken'], |
|
|
|
|
|
|
|
|
|
|
|
[['password'], 'required'], |
|
|
|
['password', 'required'], |
|
|
|
[['password'], 'string', 'min' => 6], |
|
|
|
['password', 'string', 'min' => 6], |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|