コード例 #1
0
ファイル: RegisterForm.php プロジェクト: kofeinstyle/coc
 public function initialize($entity = null, $options = null)
 {
     // Name
     $name = new Text('name');
     $name->setLabel('Ваше полное имя');
     $name->setFilters(array('striptags', 'string'));
     $name->addValidators(array(new PresenceOf(array('message' => 'Имя является обязательным параметром'))));
     $this->add($name);
     // Name
     $name = new Text('nickname');
     $name->setLabel('Никнейм в игре');
     $name->setFilters(array('alpha'));
     $name->addValidators(array(new PresenceOf(array('message' => 'Никнейм является обязательным параметром'))));
     $this->add($name);
     // Email
     $email = new Text('email');
     $email->setLabel('E-Mail');
     $email->setFilters(['email']);
     $email->addValidators(array(new PresenceOf(array('message' => 'E-mail является обязательным параметром')), new Email(array('message' => 'E-mail не верный'))));
     $this->add($email);
     // Password
     $password = new Password('password');
     $password->setLabel('Пароль');
     $password->addValidators(array(new PresenceOf(array('message' => 'Пароль является обязательным параметром'))));
     $this->add($password);
     // Confirm Password
     $repeatPassword = new Password('repeatPassword');
     $repeatPassword->setLabel('Повторите пароль');
     $repeatPassword->addValidators(array(new PresenceOf(array('message' => 'Пароль является обязательным параметром'))));
     $this->add($repeatPassword);
 }
コード例 #2
0
ファイル: RegisterForm.php プロジェクト: lss233/FiSkinAlcon
 public function initialize($entity = null, $options = null)
 {
     // Name
     $name = new Text('name');
     $name->setLabel('Your Full Name');
     $name->setFilters(array('striptags', 'string'));
     $name->addValidators(array(new PresenceOf(array('message' => 'Name is required'))));
     $this->add($name);
     // Name
     $name = new Text('username');
     $name->setLabel('Username');
     $name->setFilters(array('alpha'));
     $name->addValidators(array(new PresenceOf(array('message' => 'Please enter your desired user name'))));
     $this->add($name);
     // Email
     $email = new Text('email');
     $email->setLabel('E-Mail');
     $email->setFilters('email');
     $email->addValidators(array(new PresenceOf(array('message' => 'E-mail is required')), new Email(array('message' => 'E-mail is not valid'))));
     $this->add($email);
     // Password
     $password = new Password('password');
     $password->setLabel('Password');
     $password->addValidators(array(new PresenceOf(array('message' => 'Password is required'))));
     $this->add($password);
     // Confirm Password
     $repeatPassword = new Password('repeatPassword');
     $repeatPassword->setLabel('Repeat Password');
     $repeatPassword->addValidators(array(new PresenceOf(array('message' => 'Confirmation password is required'))));
     $this->add($repeatPassword);
 }
コード例 #3
0
ファイル: Password.php プロジェクト: mrbubblesort/waitlist
 public function initialize($entity = null, $user_options = array())
 {
     $curr_password = new Element\Password('current_password');
     $curr_password->setLabel('Current Password');
     $curr_password->setFilters(array('striptags', 'trim'));
     $curr_password->addValidators(array(new EveValidator\User\PasswordCheck()));
     $this->add($curr_password);
     $password = new Element\Password('password');
     $password->setLabel('New Password');
     $password->setFilters(array('striptags', 'trim'));
     $password->addValidators(array(new Validator\Regex(array('pattern' => '/[A-Za-z\\d\\W]+/i', 'message' => 'Password must be greater than 6 characters')), new Validator\StringLength(array('max' => 100, 'min' => 6, 'messageMaximum' => 'Password is too long', 'messageMinimum' => 'Password is too short'))));
     $password->setAttributes(array('data-toggle' => 'popover', 'data-content' => 'Password must be greater than 6 characters', 'data-title' => 'Help'));
     $this->add($password);
     $password_again = new Element\Password('password_again');
     $password_again->setLabel('Re-enter New Password');
     $password_again->setFilters(array('striptags', 'trim'));
     $password_again->addValidators(array(new Validator\Confirmation(array('message' => 'Passwords do not match', 'with' => 'password'))));
     $this->add($password_again);
     $submit = new Element\Submit('submit');
     $submit->setLabel('Save');
     $submit->setUserOption('icon', 'user');
     $submit->setAttribute('value', 'Save');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
コード例 #4
0
 public function initialize($entity = null, $options = null)
 {
     //姓名
     $name = new Text('name');
     $name->setLabel('姓 名');
     $name->setFilters(array('striptags', 'string'));
     $name->addValidators(array(new PresenceOf(array('message' => '请输入用户的姓名'))));
     $this->add($name);
     //用户名
     $name = new Text('username');
     $name->setLabel('用户名');
     $name->setFilters(array('alpha'));
     $name->addValidators(array(new PresenceOf(array('message' => '请输入用户名'))));
     $this->add($name);
     //邮箱
     $email = new Text('email');
     $email->setLabel('邮 箱');
     $email->setFilters('email');
     $email->addValidators(array(new PresenceOf(array('message' => '请输入邮箱')), new Email(array('message' => '不是有效的邮箱'))));
     $this->add($email);
     //密码
     $password = new Password('password');
     $password->setLabel('密 码');
     $password->addValidators(array(new PresenceOf(array('message' => '请输入密码'))));
     $this->add($password);
     //确认密码
     $repeatPassword = new Password('repeatPassword');
     $repeatPassword->setLabel('二次密码');
     $repeatPassword->addValidators(array(new PresenceOf(array('message' => '请再次输入密码'))));
     $this->add($repeatPassword);
 }
コード例 #5
0
 public function initialize($entity = null, $options = null)
 {
     $name = new Text('name');
     $name->setLabel('Name');
     $name->addValidators(array(new PresenceOf(array('message' => 'The name is required'))));
     $this->add($name);
     //Email
     $email = new Text('email');
     $email->setLabel('E-Mail');
     $email->addValidators(array(new PresenceOf(array('message' => 'The e-mail is required')), new Email(array('message' => 'The e-mail is not valid'))));
     $this->add($email);
     //Password
     $password = new Password('password');
     $password->setLabel('Password');
     $password->addValidators(array(new PresenceOf(array('message' => 'The password is required')), new StringLength(array('min' => 8, 'messageMinimum' => 'Password is too short. Minimum 8 characters')), new Confirmation(array('message' => 'Password does not match confirmation', 'with' => 'confirmPassword'))));
     $this->add($password);
     //Confirm Password
     $confirmPassword = new Password('confirmPassword');
     $confirmPassword->setLabel('Confirm Password');
     $confirmPassword->addValidators(array(new PresenceOf(array('message' => 'The confirmation password is required'))));
     $this->add($confirmPassword);
     //Remember
     $terms = new Check('terms', array('value' => 'yes'));
     $terms->setLabel('Accept terms and conditions');
     $terms->addValidator(new Identical(array('value' => 'yes', 'message' => 'Terms and conditions must be accepted')));
     $this->add($terms);
     //CSRF
     $csrf = new Hidden('csrf');
     $csrf->addValidator(new Identical(array('value' => $this->security->getSessionToken(), 'message' => 'CSRF validation failed')));
     $this->add($csrf);
     //Sign Up
     $this->add(new Submit('Register', array('class' => 'btn btn-success')));
 }
コード例 #6
0
 public function initialize($entity = null, $options = null)
 {
     // Name
     $name = new Text('name');
     $name->setLabel('Полное имя');
     $name->setFilters(array('striptags', 'string'));
     $name->addValidators(array(new PresenceOf(array('message' => 'Имя вводить обязательно'))));
     $this->add($name);
     // Name
     $name = new Text('username');
     $name->setLabel('Имя пользователя');
     $name->setFilters(array('alpha'));
     $name->addValidators(array(new PresenceOf(array('message' => 'Это обязательное поле'))));
     $this->add($name);
     // Email
     $email = new Text('email');
     $email->setLabel('E-Mail');
     $email->setFilters('email');
     $email->addValidators(array(new PresenceOf(array('message' => 'Без email вы не зарегестрируетесь нигде')), new Email(array('message' => 'Это не настоящий email'))));
     $this->add($email);
     // Password
     $password = new Password('password');
     $password->setLabel('Пароль');
     $password->addValidators(array(new PresenceOf(array('message' => 'Придумайте пароль'))));
     $this->add($password);
     // Confirm Password
     $repeatPassword = new Password('repeatPassword');
     $repeatPassword->setLabel('Повторите пароль');
     $repeatPassword->addValidators(array(new PresenceOf(array('message' => 'Подтвердите свой пароль'))));
     $this->add($repeatPassword);
 }
コード例 #7
0
ファイル: SignUpForm.php プロジェクト: asha1412/dasshy
 /**
  * @param object $entity
  * @param array $options
  */
 public function initialize($entity = null, $options = null)
 {
     //Name
     $name = new Text('name', array('placeholder' => 'Full name'));
     $name->setLabel('Name');
     $name->addValidators(array(new PresenceOf(array('message' => 'The name is required')), new StringLength(array('min' => 8, 'messageMinimum' => 'Name is too short. Minimum 8 characters'))));
     $this->add($name);
     //Username
     $username = new Text('login', array('placeholder' => 'Username'));
     $username->addValidators(array(new PresenceOf(array('message' => 'The username is required', 'cancelOnFail' => true)), new StringLength(array('min' => 5, 'messageMinimum' => 'Username is too short. Minimum 5 characters'))));
     $this->add($username);
     //Password
     $password = new Password('password', array('placeholder' => 'Password'));
     $password->addValidators(array(new PresenceOf(array('message' => 'The password is required', 'cancelOnFail' => true)), new StringLength(array('min' => 8, 'messageMinimum' => 'Password is too short. Minimum 8 characters')), new Confirmation(array('message' => 'Password doesn\'t match confirmation', 'with' => 'confirmPassword'))));
     $this->add($password);
     //Confirm Password
     $confirmPassword = new Password('confirmPassword', array('placeholder' => 'Confirm Password', 'cancelOnFail' => true));
     $confirmPassword->addValidators(array(new PresenceOf(array('message' => 'The confirmation password is required'))));
     $this->add($confirmPassword);
     //Remember
     $terms = new Check('terms', array('value' => 'yes'));
     $terms->setLabel('Accept terms and conditions');
     $terms->addValidator(new Identical(array('value' => 'yes', 'message' => 'Terms and conditions must be accepted')));
     $this->add($terms);
     //Sign Up
     $this->add(new Submit('Sign Up', array('class' => 'btn btn-success')));
 }
コード例 #8
0
ファイル: SignUpForm.php プロジェクト: kjmtrue/blog
 public function initialize($entity = null, $options = null)
 {
     if (isset($options['edit']) && $options['edit']) {
         $id = new Hidden('id');
     } else {
         $id = new Text('id');
     }
     $username = new Text('username', array('placeholder' => 'Tran Duy Thien'));
     //<input type="text" value="" id="fullName" name="fullName">
     $username->setLabel('Tên Tài Khoản');
     //<label for="fullName">fullName</label>
     $username->addValidators(array(new PresenceOf(array('message' => 'Tài khoản không được rỗng'))));
     $this->add($username);
     //Password
     $password = new Password('password');
     $password->setLabel('Mật Khẩu');
     $password->addValidators(array(new PresenceOf(array('message' => 'Mật khẩu không được rỗng')), new StringLength(array('min' => 8, 'messageMinimum' => 'Mật khẩu phải lớn hơn 8 ký tự')), new Confirmation(array('message' => 'Mật khẩu không khớp', 'with' => 'confirmPassword'))));
     $this->add($password);
     //Confirm Password
     $confirmPassword = new Password('confirmPassword');
     $confirmPassword->setLabel('Nhập lại mật khẩu');
     $confirmPassword->addValidators(array(new PresenceOf(array('message' => 'The confirmation password is required'))));
     $this->add($confirmPassword);
     //Remember
     $terms = new Check('terms', array('value' => 'yes'));
     $terms->setLabel('Đồng ý với Điều khoản dịch vụ và chính sách bảo mật của chúng tôi');
     $terms->addValidator(new Identical(array('value' => 'yes', 'message' => 'Bạn chưa chọn')));
     $this->add($terms);
     //CSRF
     $csrf = new Hidden('csrf');
     $csrf->addValidator(new Identical(array('value' => $this->security->getSessionToken(), 'message' => 'CSRF validation failed')));
     $this->add($csrf);
     //Sign Up
     $this->add(new Submit('Sign Up', array('class' => 'btn btn-primary pull-right')));
 }
コード例 #9
0
ファイル: UsersForm.php プロジェクト: fenghuilee/Talon
 public function initialize($entity = null, $options = null)
 {
     parent::initialize();
     // In edition the id is hidden
     if (isset($options['edit']) && $options['edit']) {
         $id = new Hidden('id');
         $id->addValidators(array(new PresenceOf(array('message' => 'ID missing'))));
         $this->add($id);
     } else {
         // Password
         $password = new Password('password', array('placeholder' => 'Password'));
         $password->setLabel('Password');
         $password->addValidators(array(new PresenceOf(array('message' => 'The password is required')), new StringLength(array('min' => 8, 'messageMinimum' => 'Password is too short. Minimum 8 characters'))));
         $this->add($password);
     }
     $name = new Text('name', array('placeholder' => 'Name'));
     $name->setLabel('Name');
     $name->addValidators(array(new PresenceOf(array('message' => 'The name is required'))));
     $this->add($name);
     $email = new Text('email', array('placeholder' => 'Email'));
     $email->setLabel('Email');
     $email->addValidators(array(new PresenceOf(array('message' => 'The e-mail is required')), new Email(array('message' => 'The e-mail is not valid'))));
     $this->add($email);
     $this->add(new Select('validated', array('1' => 'Yes', '0' => 'No')));
     $this->add(new Select('active', array('1' => 'Yes', '0' => 'No')));
     $this->add(new Submit('Save'));
 }
コード例 #10
0
ファイル: SignUpForm.php プロジェクト: adiachenko/phstart
 public function initialize()
 {
     $email = new Text('email');
     $email->setLabel('Email');
     $email->addValidators([new PresenceOf(['message' => 'The email is required', 'cancelOnFail' => true]), new Email(['message' => 'Must be a valid email'])]);
     $this->add($email);
     $firstName = new Text('first-name');
     $firstName->setLabel('First Name');
     $firstName->addValidators([new PresenceOf(['message' => 'The first name is required', 'cancelOnFail' => true]), new StringLength(['min' => 3, 'max' => 40, 'messageMinimum' => 'The first name is too short. Minimum 3 characters', 'messageMaximum' => 'The first name is too long. Maximum 40 characters'])]);
     $this->add($firstName);
     $lastName = new Text('last-name');
     $lastName->setLabel('Last Name');
     $lastName->addValidators([new PresenceOf(['message' => 'The last name is required', 'cancelOnFail' => true]), new StringLength(['min' => 3, 'max' => 40, 'messageMinimum' => 'The last name is too short. Minimum 3 characters', 'messageMaximum' => 'The last name is too long. Maximum 40 characters'])]);
     $this->add($lastName);
     $middleName = new Text('middle-name');
     $middleName->setLabel('Middle Name');
     $middleName->addValidators([new StringLength(['max' => 40, 'messageMaximum' => 'The middle name is too long. Maximum 40 characters'])]);
     $this->add($middleName);
     $password = new Password('password');
     $password->setLabel('Password');
     $password->addValidators([new PresenceOf(['message' => 'The password is required', 'cancelOnFail' => true]), new StringLength(array('min' => 8, 'messageMinimum' => 'Password is too short. Minimum 8 characters')), new Regex(['pattern' => '/^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).*$/', 'message' => 'The password is not strong enough. It must contain both upper, lowercase characters and at least one digit']), new Confirmation(array('message' => 'The password does not match it\'s confirmation', 'with' => 'password-confirm'))]);
     $this->add($password);
     $confirm = new Password('password-confirm');
     $confirm->setLabel('Confirm password');
     $confirm->addValidators([new PresenceOf(['message' => 'The password confirmation is required'])]);
     $this->add($confirm);
     $csrf = new Hidden('csrf');
     $csrf->addValidator(new Identical(array('value' => $this->security->getSessionToken(), 'message' => 'CSRF validation failed')));
     $this->add($csrf);
 }
コード例 #11
0
ファイル: RegisterForm.php プロジェクト: surzm/gohome
 public function initialize($entity = null, $options = null)
 {
     //name
     $name = new Text('name');
     $name->setLabel('Представьтесь или напишите название Вашего приюта:');
     $name->addValidators(array(new PresenceOf(array('message' => 'Обязательное поле'))));
     $this->add($name);
     //email
     $email = new Text('email');
     $email->setLabel('Введите Ваш E-mail:');
     $email->addValidators(array(new PresenceOf(array('message' => 'Обязательное поле')), new Email(array('message' => 'Введите правильный E-mail'))));
     $this->add($email);
     //Phone
     $number = new Text('number');
     $number->setLabel('Напишите телефон, по которому с Вами можно связаться:');
     $number->addValidators(array(new PresenceOf(array('message' => 'Обязательное поле'))));
     $this->add($number);
     //password
     $password = new Password('password');
     $password->setLabel('Придумайте пароль:');
     $password->addValidators(array(new PresenceOf(array('message' => 'Обязательно поле')), new StringLength(array('min' => 8, 'messageMinimum' => 'Слишком короткий, минимум - 8 символов')), new Confirmation(array('message' => 'Пароль не подтвержден', 'with' => 'confirmPassword'))));
     $this->add($password);
     // Confirm Password
     $confirmPassword = new Password('confirmPassword');
     $confirmPassword->setLabel('Подтвердите пароль:');
     $confirmPassword->addValidators(array(new PresenceOf(array('message' => 'The confirmation password is required'))));
     $this->add($confirmPassword);
     // CSRF
     $csrf = new Hidden('csrf');
     $csrf->addValidator(new Identical(array('value' => $this->security->getSessionToken(), 'message' => 'CSRF validation failed')));
     $this->add($csrf);
     // Sign Up
     $this->add(new Submit('Sign Up', array('class' => 'btn btn-success')));
 }
コード例 #12
0
 public function initialize()
 {
     $password = new Password('password');
     $password->addValidators([new PresenceOf(['message' => 'ERR_USER_NEW_PASSWORD_REQUIRED']), new StringLength(['min' => 6, 'messageMinimum' => 'ERR_USER_NEW_PASSWORD_TOO_SHORT_MIN_6']), new NotSameValidator(['message' => 'ERR_USER_PASSWORD_OLD_AND_NEW_THE_SAME', 'with' => 'oldPassword'])]);
     $this->add($password);
     $oldPassword = new Password('oldPassword');
     $oldPassword->addValidators([new PresenceOf(['message' => 'ERR_USER_OLD_PASSWORD_REQUIRED']), new OldPasswordValidator()]);
     $this->add($oldPassword);
 }
コード例 #13
0
 public function initialize()
 {
     //Password
     $password = new Password('password');
     $password->addValidators(array(new PresenceOf(array('message' => 'Пароль обязателен')), new StringLength(array('min' => 8, 'messageMinimum' => 'Пароль слишком короткий. Минимум 8 знаков')), new Confirmation(array('message' => 'Не совпадение в поле подтверждения', 'with' => 'confirmPassword'))));
     $this->add($password);
     //Confirm Password
     $confirmPassword = new Password('confirmPassword');
     $confirmPassword->addValidators(array(new PresenceOf(array('message' => 'Подтверждение пароля обязательно'))));
     $this->add($confirmPassword);
 }
コード例 #14
0
ファイル: LoginForm.php プロジェクト: skybird/EvaUser
 public function initialize($entity = null, $options = null)
 {
     $name = new Text('identify');
     $name->addValidators(array(new PresenceOf(array('message' => 'Please input username or email'))));
     $this->add($name);
     // Password
     $password = new Password('password');
     $password->setLabel('Password');
     $password->addValidators(array(new PresenceOf(array('message' => 'The password is required')), new StringLength(array('min' => 6, 'max' => 26, 'messageMinimum' => 'Password is too short. Minimum 6 characters', 'messageMaximum' => 'Password is too long. Maximum 26 characters'))));
     $this->add($password);
 }
コード例 #15
0
ファイル: OAuthLoginForm.php プロジェクト: skybird/phalcon
 public function initialize($entity = null, $options = null)
 {
     $name = new Text('identify');
     $name->addValidators(array(new PresenceOf(array('message' => 'The field is required'))));
     $this->add($name);
     // Password
     $password = new Password('password');
     $password->setLabel('Password');
     $password->addValidators(array(new PresenceOf(array('message' => 'The password is required')), new StringLength(array('min' => 8, 'messageMinimum' => 'Password is too short. Minimum 8 characters'))));
     $this->add($password);
 }
コード例 #16
0
 public function initialize()
 {
     // Password
     $password = new Password('password');
     $password->addValidators(array(new PresenceOf(array('message' => 'Password is required')), new StringLength(array('min' => 8, 'messageMinimum' => 'Password is too short. Minimum 8 characters')), new Confirmation(array('message' => 'Password doesn\'t match confirmation', 'with' => 'confirmPassword'))));
     $this->add($password);
     // Confirm Password
     $confirmPassword = new Password('confirmPassword');
     $confirmPassword->addValidators(array(new PresenceOf(array('message' => 'The confirmation password is required'))));
     $this->add($confirmPassword);
 }
コード例 #17
0
ファイル: RegisterForm.php プロジェクト: skybird/phalcon
 public function initialize($entity = null, $options = null)
 {
     $name = new Text('username');
     $name->setLabel('Name');
     $name->addValidators(array(new PresenceOf(array('message' => 'Username is required')), new Regex(array('pattern' => '/[0-9a-zA-Z_]+/', 'message' => 'Username is alphanumerics and underline only')), new StringLength(array('min' => 4, 'max' => 24, 'messageMinimum' => 'Username is too short. Minimum 4 characters', 'messageMaximum' => 'Username is too long. Maximum 24 characters'))));
     $this->add($name);
     // Email
     $email = new Text('email');
     $email->setLabel('Email');
     $email->addValidators(array(new PresenceOf(array('message' => 'Email is required')), new Email(array('message' => 'Email is not valid'))));
     $this->add($email);
     // Password
     $password = new Password('password');
     $password->setLabel('Password');
     $password->addValidators(array(new PresenceOf(array('message' => 'The password is required')), new StringLength(array('min' => 6, 'max' => 26, 'messageMinimum' => 'Password is too short. Minimum 6 characters', 'messageMaximum' => 'Password is too long. Maximum 26 characters'))));
     $this->add($password);
     // Confirm Password
     /*
     $confirmPassword = new Password('passwordConfirm');
     $confirmPassword->setLabel('Confirm Password');
     $confirmPassword->addValidators(array(
         new PresenceOf(array(
             'message' => 'The confirmation password is required'
         )),
         new Confirmation(array(
             'message' => 'Password doesn\'t match',
             'with' => 'password'
         ))
     ));
     $this->add($confirmPassword);
     */
     // Remember
     $terms = new Check('agree', array('value' => 'yes'));
     $terms->setLabel('Accept terms and conditions');
     $terms->addValidator(new Identical(array('value' => 'yes', 'message' => 'Terms and conditions must be accepted')));
     $this->add($terms);
     /*
     // CSRF
     $csrf = new Hidden('csrf');
     
     $csrf->addValidator(new Identical(array(
         'value' => $this->security->getSessionToken(),
         'message' => 'CSRF validation failed'
     )));
     
     $this->add($csrf);
     
     // Sign Up
     $this->add(new Submit('Sign Up', array(
         'class' => 'btn btn-success'
     )));
     */
 }
コード例 #18
0
ファイル: ClienteForm.php プロジェクト: zedmaster/ticobox
 public function initialize($entity = null, $options = null)
 {
     // Name
     $name = new Text('nome', ['class' => 'form-control']);
     $name->setLabel('Nome');
     $name->setFilters(array('striptags', 'string'));
     $name->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher o Nome'))));
     $this->add($name);
     // Email
     $email = new Text('email', ['class' => 'form-control']);
     $email->setLabel('E-Mail');
     $email->setFilters('email');
     $email->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher o E-mail')), new Email(array('message' => 'Formato de E-mail inválido'))));
     $this->add($email);
     // Password
     $password = new Password('senha', ['class' => 'form-control']);
     $password->setLabel('Senha');
     $password->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher a Senha'))));
     $this->add($password);
     // Confirm Password
     $repeatPassword = new Password('confirmar', ['class' => 'form-control']);
     $repeatPassword->setLabel('Confirmar Senha');
     $repeatPassword->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher Confirmar Senha')), new Confirmation(['message' => 'Erro na Confirmação da Senha', 'with' => 'senha'])));
     $this->add($repeatPassword);
     // CPF
     $cpf = new Text('cpf', ['class' => 'form-control']);
     $cpf->setLabel('CPF');
     $cpf->setFilters(array('striptags', 'string'));
     $cpf->addValidators(array(new PresenceOf(array('message' => 'É necessário preencher o CPF')), new Cpf()));
     $this->add($cpf);
     // RG
     /*
     $rg = new Text('rg', ['class' => 'form-control']);
     $rg->setLabel('RG');
     $rg->setFilters(array('striptags', 'string'));
     $this->add($rg);
     */
     // Telefone
     $telefone = new Text('telefone', ['class' => 'form-control']);
     $telefone->setLabel('Telefone');
     $telefone->setFilters(array('striptags', 'string'));
     $this->add($telefone);
     // Celular
     $celular = new Text('celular', ['class' => 'form-control']);
     $celular->setLabel('celular');
     $celular->setFilters(array('striptags', 'string'));
     $this->add($celular);
     // Submit
     $submit = new Submit('Enviar', ['class' => 'btn btn-default']);
     $submit->setLabel(' ');
     $this->add($submit);
 }
コード例 #19
0
 public function initialize()
 {
     //New password
     $passwordNew = new Password('password_new', array('placeholder' => 'New password', 'class' => 'form-control', 'autocomplete' => 'off'));
     $passwordNew->addValidators(array(new PresenceOf(array('message' => 'Password is required')), new StringLength(array('min' => 5, 'messageMinimum' => 'Password is too short. Minimum 5 characters')), new Confirmation(array('message' => 'Password doesn\'t match confirmation', 'with' => 'password_new_confirm'))));
     $this->add($passwordNew);
     //Confirm New Password
     $passwordNewConfirm = new Password('password_new_confirm', array('placeholder' => 'Confirm new password', 'class' => 'form-control', 'autocomplete' => 'off'));
     $passwordNewConfirm->addValidator(new PresenceOf(array('message' => 'The confirmation password is required')));
     $this->add($passwordNewConfirm);
     //Submit
     $this->add(new Submit('change', ['class' => 'submit-button-login', 'value' => 'Sign in']));
 }
コード例 #20
0
ファイル: LoginForm.php プロジェクト: CloudOJ/ums
 public function initialize($entity = null, $options = array())
 {
     //Username
     $username = new Text("username", array("class" => "form-control", "placeholder" => $this->i18n->user_login_username));
     $username->setFilters(array('striptags', 'string'));
     $username->addValidators(array(new PresenceOf(array('message' => $this->i18n->user_login_usernamerequired))));
     $this->add($username);
     //Password
     $password = new Password("password", array("class" => "form-control", "placeholder" => $this->i18n->user_password));
     $password->setFilters(array('striptags', 'string'));
     $password->addValidators(array(new PresenceOf(array('message' => $this->i18n->user_login_passwordrequired))));
     $this->add($password);
 }
コード例 #21
0
ファイル: ResetPasswordForm.php プロジェクト: skybird/phalcon
 public function initialize($entity = null, $options = null)
 {
     // Password
     $password = new Password('password');
     $password->setLabel('Password');
     $password->addValidators(array(new PresenceOf(array('message' => 'The password is required')), new StringLength(array('min' => 6, 'messageMinimum' => 'Password is too short. Minimum 6 characters')), new Confirmation(array('message' => 'Password doesn\'t match confirmation', 'with' => 'passwordConfirm'))));
     $this->add($password);
     // Confirm Password
     $confirmPassword = new Password('passwordConfirm');
     $confirmPassword->setLabel('Confirm Password');
     $confirmPassword->addValidators(array(new PresenceOf(array('message' => 'The confirmation password is required'))));
     $this->add($confirmPassword);
 }
コード例 #22
0
 public function initialize($entity = null, $options = null)
 {
     // Password
     $password = new Password('password');
     $password->setLabel('Password');
     $password->addValidators(array(new PresenceOf(array('message' => 'The password is required')), new StringLength(array('min' => 6, 'messageMinimum' => 'Password is too short. Minimum 6 characters'))));
     $this->add($password);
     // Captcha
     $captcha = new Text('captcha');
     $captcha->setLabel('Captcha');
     $captcha->addValidators(array(new PresenceOf(array('message' => 'The captcha is required'))));
     $this->add($captcha);
 }
コード例 #23
0
 public function initialize()
 {
     $username = new Text('username');
     $username->setLabel('用户名');
     $username->addValidators([new PresenceOf(['message' => '用户名必填']), new StringLength(['min' => 4, 'max' => 20, 'messageMinimum' => '用户名长度应大于4', 'messageMaximum' => '用户名长度应小于20'])]);
     $this->add($username);
     $password = new Password('password');
     $password->setLabel('密码');
     $password->addValidators([new PresenceOf(['message' => '密码必填']), new StringLength(['min' => 6, 'messageMinimum' => '密码应大于6个字符'])]);
     $this->add($password);
     $remember = new Check('remember');
     $remember->setLabel('记住登录');
     $this->add($remember);
 }
コード例 #24
0
ファイル: Add.php プロジェクト: mrbubblesort/waitlist
 public function initialize($entity = null, $user_options = array())
 {
     // Login details
     $username = new Element\Text('username');
     $username->setLabel('Email');
     $username->setFilters(array('striptags', 'trim'));
     $username->addValidators(array(new Validator\Email(array('message' => 'This is not a valid email')), new EveValidator\User\Unique(array('message' => 'Email already registered'))));
     $username->setAttributes(array('data-toggle' => 'popover', 'data-content' => 'Enter an email address', 'data-title' => 'Help'));
     $this->add($username);
     $username_again = new Element\Text('username_again');
     $username_again->setLabel('Re-enter email');
     $username_again->setFilters(array('striptags', 'trim'));
     $username_again->addValidators(array(new Validator\Confirmation(array('message' => 'Emails do not match', 'with' => 'username'))));
     $this->add($username_again);
     $password = new Element\Password('password');
     $password->setLabel('Password');
     $password->setFilters(array('striptags', 'trim'));
     $password->addValidators(array(new Validator\Regex(array('pattern' => '/[A-Za-z\\d\\W]+/i', 'message' => 'Password must be greater than 6 characters')), new Validator\StringLength(array('max' => 100, 'min' => 6, 'messageMaximum' => 'Password is too long', 'messageMinimum' => 'Password is too short'))));
     $password->setAttributes(array('data-toggle' => 'popover', 'data-content' => 'Password must be greater than 6 characters', 'data-title' => 'Help'));
     $this->add($password);
     $password_again = new Element\Password('password_again');
     $password_again->setLabel('Re-enter password');
     $password_again->setFilters(array('striptags', 'trim'));
     $password_again->addValidators(array(new Validator\Confirmation(array('message' => 'Passwords do not match', 'with' => 'password'))));
     $this->add($password_again);
     $name = new Element\Text('name');
     $name->setLabel('Name');
     $name->setFilters(array('striptags', 'trim'));
     $this->add($name);
     $teamspeak = new Element\Text('teamspeak');
     $teamspeak->setLabel('Teamspeak');
     $teamspeak->setFilters(array('striptags', 'trim'));
     $this->add($teamspeak);
     $character = new Element\Text('character');
     $character->setLabel('Character name');
     $character->setFilters(array('striptags', 'trim'));
     $character->addValidator(new Validator\PresenceOf(array('message' => 'This field is required')));
     $this->add($character);
     $game_id = new Element\Text('game_id');
     $game_id->setLabel('Character In-Game ID');
     $game_id->setFilters(array('striptags', 'trim'));
     $game_id->addValidator(new Validator\PresenceOf(array('message' => 'This field is required')));
     $this->add($game_id);
     $submit = new Element\Submit('submit');
     $submit->setLabel('Register');
     $submit->setUserOption('icon', 'user');
     $submit->setAttribute('value', 'Register');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
コード例 #25
0
 /**
  * Form configuration
  */
 public function initialize()
 {
     $t = $this->getDI()->get('translate');
     $passwordMinLength = $this->config->security->passwordMinLength;
     // Password
     $password = new Password('password');
     $password->setLabel($t->gettext('Password'));
     $password->addValidators([new PresenceOf(['message' => $t->gettext('Password is required')]), new StringLength(['min' => $passwordMinLength, 'messageMinimum' => sprintf($t->gettext('Password is too short. Minimum %d characters'), $passwordMinLength)]), new Confirmation(['message' => $t->gettext('Password doesn\'t match confirmation'), 'with' => 'confirmPassword'])]);
     $this->add($password);
     // Confirm Password
     $confirmPassword = new Password('confirmPassword');
     $confirmPassword->setLabel($t->gettext('Confirm Password'));
     $confirmPassword->addValidators([new PresenceOf(['message' => $t->gettext('The confirmation password is required')])]);
     $this->add($confirmPassword);
 }
コード例 #26
0
 public function initialize()
 {
     parent::initialize();
     // Password
     $password = new Password('password', array('placeholder' => 'Password'));
     $password->setLabel('New Password');
     $password->addValidators(array(new PresenceOf(array('message' => 'The password is required')), new StringLength(array('min' => 8, 'messageMinimum' => 'Password is too short. Minimum 8 characters')), new Confirmation(array('message' => 'Password doesn\'t match confirmation', 'with' => 'confirmPassword'))));
     $this->add($password);
     // Confirm Password
     $confirmPassword = new Password('confirmPassword', array('placeholder' => 'Confirm Password'));
     $confirmPassword->setLabel('Confirm New Password');
     $confirmPassword->addValidators(array(new PresenceOf(array('message' => 'The confirmation password is required'))));
     $this->add($confirmPassword);
     // Sign Up
     $this->add(new Submit('Change Password', array('class' => 'btn btn-success')));
 }
コード例 #27
0
ファイル: SignInForm.php プロジェクト: adiachenko/phstart
 public function initialize()
 {
     $email = new Text('email');
     $email->setLabel('Email');
     $email->addValidators([new PresenceOf(['message' => 'The email is required', 'cancelOnFail' => true]), new Email(['message' => 'Must be a valid email'])]);
     $this->add($email);
     $password = new Password('password');
     $password->setLabel('Password');
     $password->addValidators([new PresenceOf(['message' => 'The password is required', 'cancelOnFail' => true])]);
     $this->add($password);
     $remember = new Check('remember', ['checked' => 'checked']);
     $this->add($remember);
     $csrf = new Hidden('csrf');
     $csrf->addValidator(new Identical(array('value' => $this->security->getSessionToken(), 'message' => 'CSRF validation failed')));
     $this->add($csrf);
 }
コード例 #28
0
 public function initialize()
 {
     //current password
     $passwd = new Password('passwd', array('placeholder' => t('Enter your current password'), 'class' => 'form-control', 'autofocus' => true, 'autocomplete' => 'off'));
     $passwd->addValidator(new PresenceOf(array('message' => t('We need your current password.'))));
     $this->add($passwd);
     //New password
     $passwdNew = new Password('passwd_new', array('placeholder' => t('New password'), 'class' => 'form-control', 'autocomplete' => 'off'));
     $passwdNew->addValidators(array(new PresenceOf(array('message' => t('Password is required'))), new StringLength(array('min' => 5, 'messageMinimum' => t('Password is too short. Minimum 5 characters'))), new Confirmation(array('message' => t('Password doesn\'t match confirmation'), 'with' => 'passwd_new_confirm'))));
     $this->add($passwdNew);
     //Confirm New Password
     $passwdNewConfirm = new Password('passwd_new_confirm', array('placeholder' => t('Confirm new password'), 'class' => 'form-control', 'autocomplete' => 'off'));
     $passwdNewConfirm->addValidator(new PresenceOf(array('message' => t('The confirmation password is required'))));
     $this->add($passwdNewConfirm);
     //Submit
     $this->add(new Submit('save', ['class' => 'button color small submit', 'value' => t('Save')]));
 }
コード例 #29
0
 public function initialize($entity = null, $options = null)
 {
     //Current Password
     if (isset($options['must_change_password']) && $options['must_change_password'] == 1) {
     } else {
         $currentPassword = new Password('currentPassword');
         $currentPassword->addValidators(array(new PresenceOf(array('message' => 'Current password is required'))));
         $this->add($currentPassword);
     }
     $password = new Password('password');
     $password->addValidators(array(new PresenceOf(array('message' => 'Password is required')), new StringLength(array('min' => 8, 'messageMinimum' => 'Password is too short. Minimum 8 characters')), new Confirmation(array('message' => 'Password doesn\'t match confirmation', 'with' => 'confirmPassword'))));
     $this->add($password);
     //Confirm Password
     $confirmPassword = new Password('confirmPassword');
     $confirmPassword->addValidators(array(new PresenceOf(array('message' => 'The confirmation password is required'))));
     $this->add($confirmPassword);
 }
コード例 #30
0
ファイル: SessionForm.php プロジェクト: surzm/gohome
 public function initialize()
 {
     //email
     $email = new Text('email', array('placeholder' => 'Email'));
     $email->addValidators(array(new PresenceOf(array('message' => 'Введите Ваш E-mail'))));
     $this->add($email);
     //password
     $password = new Password('password', array('placeholder' => 'Password'));
     $password->addValidators(array(new PresenceOf(array('message' => 'Введите пароль'))));
     $password->clear();
     $this->add($password);
     // CSRF
     $csrf = new Hidden('csrf');
     $csrf->addValidator(new Identical(array('value' => $this->security->getSessionToken(), 'message' => 'CSRF validation failed')));
     $csrf->clear();
     $this->add($csrf);
     $this->add(new Submit('go', array('class' => 'btn btn-success')));
 }