Esempio n. 1
0
 public function rules()
 {
     return [[['login', 'pass'], 'string', 'max' => 100], [['login', 'email'], 'unique'], ['email', 'email'], ['newsletter', 'boolean'], [['house_nr', 'flat_nr'], 'integer'], [['name', 'surname', 'street', 'city'], 'string'], ['pass', 'string', 'min' => 6], ['zipcode', 'match', 'pattern' => '/^\\d{2}-\\d{3}$/'], [['email', 'pass'], 'required', 'on' => self::SCENARIO_CREATE], [['login', 'email'], 'required', 'on' => self::SCENARIO_UPDATE], [['user_id', 'image', 'login', 'pass', 'pass_repeat', 'email', 'name', 'surname', 'street', 'house_nr', 'flat_nr', 'zipcode', 'city', 'user_role', 'newsletter'], 'safe'], ['login', LoginValidator::className(), 'on' => self::SCENARIO_CREATE], ['email', EmailValidator::className(), 'on' => self::SCENARIO_CREATE], ['email', EmailUpdateValidator::className(), 'on' => self::SCENARIO_UPDATE], ['pass', 'match', 'pattern' => '^(?=.*\\d)^', 'message' => 'Hasło powinno zawiera chociaż jedną cyfrę.', 'on' => [self::SCENARIO_UPDATE, self::SCENARIO_CREATE]], ['pass_repeat', 'compare', 'compareAttribute' => 'pass'], [['image', 'filename'], 'file', 'extensions' => 'jpg, gif, png']];
 }
Esempio n. 2
0
 public function rules()
 {
     return [['login', LoginFilter::className()], ['login', LoginValidator::className()], ['login', 'required'], ['login', 'validatePolzovatel'], ['parol', 'required'], ['parol', 'validateParol'], ['zapomnit', 'boolean']];
 }
Esempio n. 3
0
 public function rules()
 {
     return [[['familiya', 'imya', 'otchestvo'], SqueezeLineFilter::className()], [['familiya', 'imya', 'otchestvo'], ImyaChelovekaValidator::className()], [['familiya', 'imya'], 'required'], ['otchestvo', 'default'], ['email', 'email'], ['email', 'required'], ['telefon', TelefonValidator::className()], ['telefon', 'default'], [['rabotaOrgAdres', 'rabotaOrgVedomstvo'], 'integer'], [['rabotaOrgAdres', 'rabotaOrgVedomstvo'], 'required'], ['rabotaOrgId', 'integer'], ['rabotaOrgId', RequiredWhenTargetIsEmpty::className(), 'targetModel' => $this, 'targetAttribute' => 'rabotaOrgNazvanie'], ['rabotaOrgId', 'default'], ['rabotaOrgNazvanie', SqueezeLineFilter::className()], ['rabotaOrgNazvanie', NazvanieValidator::className()], ['rabotaOrgNazvanie', RequiredWhenTargetIsEmpty::className(), 'targetModel' => $this, 'targetAttribute' => 'rabotaOrgId'], ['rabotaOrgNazvanie', 'default'], ['rabotaDolzhnostId', 'integer'], ['rabotaDolzhnostId', RequiredWhenTargetIsEmpty::className(), 'targetModel' => $this, 'targetAttribute' => 'rabotaDolzhnostNazvanie'], ['rabotaDolzhnostId', 'default'], ['rabotaDolzhnostNazvanie', SqueezeLineFilter::className()], ['rabotaDolzhnostNazvanie', NazvanieValidator::className()], ['rabotaDolzhnostNazvanie', RequiredWhenTargetIsEmpty::className(), 'targetModel' => $this, 'targetAttribute' => 'rabotaDolzhnostId'], ['rabotaDolzhnostNazvanie', 'default'], ['rabotaEtapObrazovaniya', EnumValidator::className(), 'enumClass' => EtapObrazovaniya::className()], ['rabotaEtapObrazovaniya', 'default'], ['rabotaTelefon', TelefonValidator::className()], ['rabotaTelefon', 'default'], ['login', LoginFilter::className()], ['login', LoginValidator::className()], ['login', 'unique', 'targetClass' => Polzovatel::className(), 'targetAttribute' => 'login'], ['login', 'required'], ['podtverzhdenieParolya', 'compare', 'compareAttribute' => 'parol', 'message' => 'Пароль должен совпадать с подтверждением пароля.'], [['parol', 'podtverzhdenieParolya'], 'required'], [['roli'], 'required']];
 }
Esempio n. 4
0
 public function rules()
 {
     return [['login', 'required'], ['login', LoginValidator::className()], ['login', 'exist', 'targetAttribute' => 'login', 'targetClass' => Polzovatel::className()], ['kod', 'required'], ['kod', 'validateKod']];
 }