mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-29 13:57:50 +08:00
Fixed apps rules
This commit is contained in:
@@ -23,9 +23,9 @@ class LoginForm extends Model
|
||||
// username and password are both required
|
||||
[['username', 'password'], 'required'],
|
||||
// password is validated by validatePassword()
|
||||
[['password'], 'validatePassword'],
|
||||
['password', 'validatePassword'],
|
||||
// rememberMe must be a boolean value
|
||||
[['rememberMe'], 'boolean'],
|
||||
['rememberMe', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -104,18 +104,18 @@ class User extends ActiveRecord implements IdentityInterface
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['username'], 'filter', 'filter' => 'trim'],
|
||||
[['username'], 'required'],
|
||||
[['username'], 'string', 'min' => 2, 'max' => 255],
|
||||
['username', 'filter', 'filter' => 'trim'],
|
||||
['username', 'required'],
|
||||
['username', 'string', 'min' => 2, 'max' => 255],
|
||||
|
||||
[['email'], 'filter', 'filter' => 'trim'],
|
||||
[['email'], 'required'],
|
||||
[['email'], 'email'],
|
||||
[['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', 'filter', 'filter' => 'trim'],
|
||||
['email', 'required'],
|
||||
['email', 'email'],
|
||||
['email', 'unique', 'message' => 'This email address has already been taken.', 'on' => 'signup'],
|
||||
['email', 'exist', 'message' => 'There is no user with such email.', 'on' => 'requestPasswordResetToken'],
|
||||
|
||||
[['password'], 'required'],
|
||||
[['password'], 'string', 'min' => 6],
|
||||
['password', 'required'],
|
||||
['password', 'string', 'min' => 6],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ class ContactForm extends Model
|
||||
// name, email, subject and body are required
|
||||
[['name', 'email', 'subject', 'body'], 'required'],
|
||||
// email has to be a valid email address
|
||||
[['email'], 'email'],
|
||||
['email', 'email'],
|
||||
// verifyCode needs to be entered correctly
|
||||
[['verifyCode'], 'captcha'],
|
||||
['verifyCode', 'captcha'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -25,9 +25,9 @@ class ContactForm extends Model
|
||||
// name, email, subject and body are required
|
||||
[['name', 'email', 'subject', 'body'], 'required'],
|
||||
// email has to be a valid email address
|
||||
[['email'], 'email'],
|
||||
['email', 'email'],
|
||||
// verifyCode needs to be entered correctly
|
||||
[['verifyCode'], 'captcha'],
|
||||
['verifyCode', 'captcha'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ class LoginForm extends Model
|
||||
// username and password are both required
|
||||
[['username', 'password'], 'required'],
|
||||
// password is validated by validatePassword()
|
||||
[['password'], 'validatePassword'],
|
||||
['password', 'validatePassword'],
|
||||
// rememberMe must be a boolean value
|
||||
[['rememberMe'], 'boolean'],
|
||||
['rememberMe', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user