Esempio n. 1
0
 public function init()
 {
     $registry = Zend_Registry::getInstance();
     $config = $registry->get("config");
     $auth = Zend_Auth::getInstance();
     $this->setMethod('post');
     $this->addElementPrefixPath('Ml_Validate', 'Ml/Validate/', Zend_Form_Element::VALIDATE);
     $this->addElementPrefixPath('Ml_Filter', 'Ml/Filter/', Zend_Form_Element::FILTER);
     if ($auth->hasIdentity()) {
         $this->addElement('password', 'currentpassword', array('filters' => array('StringTrim'), 'validators' => array(array('validator' => 'matchPassword')), 'autocomplete' => 'off', 'required' => true, 'label' => 'Current Password:'******'class' => 'span3'));
     }
     $this->addElement('password', 'password', array('filters' => array('StringTrim'), 'description' => "Six or more characters required; case-sensitive", 'validators' => array(array('validator' => 'StringLength', 'options' => array(6, 20)), array('validator' => 'Hardpassword'), array('validator' => 'newPassword'), array('validator' => 'newPasswordRepeat')), 'autocomplete' => 'off', 'required' => true, 'label' => 'New Password:'******'class' => 'span3'));
     $this->addElement('password', 'password_confirm', array('filters' => array('StringTrim'), 'required' => true, 'label' => 'Confirm Password:'******'autocomplete' => 'off', 'class' => 'span3'));
     if ($registry->isRegistered("changeUserProperPassword")) {
         $this->addElement(Ml_Model_AntiAttack::captchaElement());
     }
     $this->addElement('submit', 'submit', array('label' => 'Change it!', 'class' => 'btn primary'));
     if ($config['ssl']) {
         $this->getElement("submit")->addValidator("Https");
         //By default the submit element doesn't display a error decorator
         $this->getElement("submit")->addDecorator("Errors");
     }
     if ($auth->hasIdentity()) {
         $this->addElement(Ml_Model_MagicCookies::formElement());
     }
     $this->setAttrib('class', 'form-stacked');
 }
Esempio n. 2
0
 public function init()
 {
     $this->setMethod('post');
     $this->addElementPrefixPath('Ml_Validate', 'Ml/Validate/', Zend_Form_Element::VALIDATE);
     $this->addElementPrefixPath('Ml_Filter', 'Ml/Filter/', Zend_Form_Element::FILTER);
     $this->addElement('text', 'recover', array('label' => 'Username or e-mail:', 'required' => true, 'filters' => array('StringTrim', 'StringToLower'), 'validators' => array(array('validator' => 'StringLength', 'options' => array(1, 100)), array('validator' => 'accountRecover')), 'autocomplete' => 'off'));
     $this->addElement(Ml_Model_AntiAttack::captchaElement());
     $this->addElement('submit', 'submit', array('label' => 'E-mail me!', 'class' => 'btn primary'));
     $this->setAttrib('class', 'form-stacked');
 }
Esempio n. 3
0
 public function init()
 {
     $this->setMethod('post');
     $this->addElementPrefixPath('Ml_Validate', 'Ml/Validate/', Zend_Form_Element::VALIDATE);
     $this->addElementPrefixPath('Ml_Filter', 'Ml/Filter/', Zend_Form_Element::FILTER);
     $this->addElement('password', 'password', array('filters' => array('StringTrim'), 'validators' => array(array('validator' => 'matchPassword')), 'required' => true, 'label' => 'Current Password:'******'hash', 'no_csrf_foo', array('salt' => 'K*#%JQk74#$*%Ĉ#%R*b', 'timeout' => 600));
     $this->addElement(Ml_Model_AntiAttack::captchaElement());
     $this->addElement('submit', 'submit', array('label' => 'Delete your account', 'class' => 'btn danger'));
     $this->setAttrib('class', 'form-stacked');
 }
Esempio n. 4
0
 public function init()
 {
     $auth = Zend_Auth::getInstance();
     $this->setMethod('post');
     $this->addElementPrefixPath('Ml_Validate', 'Ml/Validate/', Zend_Form_Element::VALIDATE);
     $this->addElementPrefixPath('Ml_Filter', 'Ml/Filter/', Zend_Form_Element::FILTER);
     $this->addElement('text', 'abuse_reference', array('label' => 'Link to the abuse:', 'required' => true, 'filters' => array('StringTrim', 'UrlFilter'), 'validators' => array(array('validator' => 'StringLength', 'options' => array(1, 512), array('validator' => 'Url')))));
     $this->addElement('textarea', 'abuse_description', array('label' => 'Explain (if necessary):', 'required' => false, 'filters' => array('StringTrim'), 'validators' => array(array('validator' => 'StringLength', 'options' => array(1, 2048)))));
     if (!$auth->hasIdentity()) {
         $this->addElement(Ml_Model_AntiAttack::captchaElement());
     }
     $this->addElement('submit', 'report_abuse', array('label' => "Let us know", 'required' => false, 'class' => 'btn primary'));
     $this->setAttrib('class', 'form-stacked');
 }
Esempio n. 5
0
 public function init()
 {
     $registry = Zend_Registry::getInstance();
     $config = $registry->get("config");
     $this->setMethod('post');
     $this->addElementPrefixPath('Ml_Validate', 'Ml/Validate/', Zend_Form_Element::VALIDATE);
     $this->addElementPrefixPath('Ml_Filter', 'Ml/Filter/', Zend_Form_Element::FILTER);
     $this->addElement('text', 'name', array('label' => 'Name:', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('validator' => 'StringLength', 'options' => array(1, 50)))));
     $email = $this->addElement('text', 'email', array('label' => 'E-mail address:', 'required' => true, 'description' => '<small>Read the <a href="/privacy" class="new-window">' . 'Privacy Policy</a> before proceeding</small>', 'filters' => array('StringTrim', 'StringToLower'), 'validators' => array(array('validator' => 'StringLength', 'options' => array(1, 60)), array('validator' => 'emailNewUser'), array('validator' => 'EmailAddress'))));
     if ($config['signup']['inviteonly']) {
         $this->addElement('text', 'invitecode', array('label' => 'Invite code:', 'required' => true, 'autoInsertNotEmptyValidator' => false, 'validators' => array(array('validator' => 'Invite'))));
         $this->getElement("invitecode")->setAttrib('class', 'span3');
     }
     $this->addElement(Ml_Model_AntiAttack::captchaElement());
     $this->addElement('submit', 'submit', array('label' => 'Sign up!', 'class' => 'btn primary'));
     $this->setAttrib('class', 'form-stacked');
 }
Esempio n. 6
0
 public function init()
 {
     $registry = Zend_Registry::getInstance();
     $config = $registry->get("config");
     $this->addElementPrefixPath('Ml_Validate', 'Ml/Validate/', Zend_Form_Element::VALIDATE);
     $this->addElementPrefixPath('Ml_Filter', 'Ml/Filter/', Zend_Form_Element::FILTER);
     $this->addElement('text', 'username', array('label' => 'Username or e-mail:', 'required' => true, 'autofocus' => 'autofocus', 'filters' => array('StringTrim', 'StringToLower'), 'validators' => array(array('validator' => 'username'))));
     $this->getElement("username")->setAttrib('required', 'required');
     $this->addElement('password', 'password', array('label' => 'Password:'******'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('validator' => 'StringLength', 'options' => array(5, 20)), array('validator' => 'password'))));
     $this->getElement("password")->setAttrib('required', 'required');
     $this->addElement('checkbox', 'remember_me', array('label' => 'Remember me'));
     if (Ml_Model_AntiAttack::ensureHuman()) {
         $this->addElement(Ml_Model_AntiAttack::captchaElement());
     }
     $login = $this->addElement('submit', 'login', array('required' => false, 'ignore' => true, 'label' => 'Sign in', 'class' => 'btn primary'));
     if ($config['ssl']) {
         $this->getElement("login")->addValidator("Https");
         //By default the submit element doesn't display a error decorator
         $this->getElement("login")->addDecorator("Errors");
     }
     $this->getElement("username")->setAttrib('class', 'span3');
     $this->getElement("password")->setAttrib('class', 'span3');
     $this->setAttrib('class', 'form-stacked');
 }