Beispiel #1
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['username', 'password'], 'required'], [['rememberMe'], 'boolean'], [['password'], 'validatePassword'], [['verifyCode'], \common\recaptcha\ReCaptchaValidator::className(), 'secret' => \common\recaptcha\ReCaptcha::SECRET_KEY, 'on' => 'error']];
 }
Beispiel #2
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['username', 'email'], 'filter', 'filter' => 'strip_tags'], ['username', 'filter', 'filter' => 'trim'], ['username', 'required'], ['username', 'unique', 'targetClass' => '\\common\\models\\User', 'message' => Yii::t('app', 'This username has already been taken.')], ['username', 'string', 'min' => 2, 'max' => 255], ['email', 'filter', 'filter' => 'trim'], ['email', 'required'], ['email', 'email'], ['email', 'string', 'max' => 255], ['email', 'unique', 'targetClass' => '\\common\\models\\User', 'message' => Yii::t('app', 'This email address has already been taken.')], ['password', 'required'], ['password', 'string', 'min' => 6], [['confirm'], 'compare', 'compareAttribute' => 'password', 'message' => Yii::t('app', 'Passwords don\'t match')], [['verifyCode'], \common\recaptcha\ReCaptchaValidator::className(), 'secret' => \common\recaptcha\ReCaptcha::SECRET_KEY], ['laws', 'required', 'requiredValue' => 1, 'message' => Yii::t('app', 'You must agree with terms')]];
 }