public function __construct($name = null, AuthenticationOptionsInterface $options) { $this->setAuthenticationOptions($options); parent::__construct($name); $this->add(array('name' => 'identity', 'options' => array('label' => ''), 'attributes' => array('type' => 'hidden'))); $this->add(array('name' => 'newIdentity', 'options' => array('label' => 'New Email'), 'attributes' => array('type' => 'text'))); $this->add(array('name' => 'newIdentityVerify', 'options' => array('label' => 'Verify New Email'), 'attributes' => array('type' => 'text'))); $this->add(array('name' => 'credential', 'options' => array('label' => 'Password'), 'attributes' => array('type' => 'password'))); $this->getEventManager()->trigger('init', $this); }
public function __construct() { parent::__construct(); $this->add(array('name' => 'username', 'options' => array('label' => 'Username'), 'attributes' => array('type' => 'text'))); $this->add(array('name' => 'email', 'options' => array('label' => 'Email'), 'attributes' => array('type' => 'text'))); $this->add(array('name' => 'display_name', 'options' => array('label' => 'Display Name'), 'attributes' => array('type' => 'text'))); $this->add(array('name' => 'password', 'options' => array('label' => 'Password'), 'attributes' => array('type' => 'password'))); $this->add(array('name' => 'passwordVerify', 'options' => array('label' => 'Password Verify'), 'attributes' => array('type' => 'password'))); if ($this->getRegistrationOptions()->getUseRegistrationFormCaptcha()) { $this->add(array('name' => 'captcha', 'type' => 'Zend\\Form\\Element\\Captcha', 'options' => array('label' => 'Please type the following text', 'captcha' => $this->getRegistrationOptions()->getFormCaptchaOptions()))); } $submitElement = new Element\Button('submit'); $submitElement->setLabel('Submit')->setAttributes(array('type' => 'submit')); $this->add($submitElement, array('priority' => -100)); $this->add(array('name' => 'userId', 'type' => 'Zend\\Form\\Element\\Hidden', 'attributes' => array('type' => 'hidden'))); // @TODO: Fix this... getValidator() is a protected method. //$csrf = new Element\Csrf('csrf'); //$csrf->getValidator()->setTimeout($this->getRegistrationOptions()->getUserFormTimeout()); //$this->add($csrf); }
public function __construct($name = null, AuthenticationOptionsInterface $options) { $this->setAuthenticationOptions($options); parent::__construct($name); $this->add(array('name' => 'identity', 'attributes' => array('type' => 'text', 'class' => 'login_username', 'placeholder' => 'Email'))); $this->add(array('name' => 'credential', 'attributes' => array('type' => 'password', 'class' => 'login_password', 'placeholder' => 'Password'))); $this->add(array('type' => 'Zend\\Form\\Element\\Checkbox', 'name' => 'remember', 'options' => array('use_hidden_element' => true, 'checked_value' => '1', 'unchecked_value' => '0'))); // @todo: Fix this // 1) getValidator() is a protected method // 2) i don't believe the login form is actually being validated by the login action // (but keep in mind we don't want to show invalid username vs invalid password or // anything like that, it should just say "login failed" without any additional info) //$csrf = new Element\Csrf('csrf'); //$csrf->getValidator()->setTimeout($options->getLoginFormTimeout()); //$this->add($csrf); $submitElement = new Element\Button('submit'); $submitElement->setLabel('Sign In')->setAttributes(array('type' => 'submit', 'class' => 'login_submit formFooterButtons rounded Button primary Module large hasText btn', 'value' => 'Zaloguj')); $this->add($submitElement, array('priority' => -100)); $this->getEventManager()->trigger('init', $this); }