From e4d3c4db0929770ebf70fd0d943821c5ca128519 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Mon, 21 Mar 2011 10:06:49 +0100 Subject: Login in User Module --- application/modules/user/forms/Login.php | 27 +++++- application/modules/user/forms/RecoverPassword.php | 28 ++++++ application/modules/user/forms/Register.php | 105 +++++++++++++++++++++ 3 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 application/modules/user/forms/RecoverPassword.php create mode 100644 application/modules/user/forms/Register.php (limited to 'application/modules/user/forms') diff --git a/application/modules/user/forms/Login.php b/application/modules/user/forms/Login.php index 58c5cc9..342e0b2 100644 --- a/application/modules/user/forms/Login.php +++ b/application/modules/user/forms/Login.php @@ -5,7 +5,32 @@ class user_Form_Login extends Zend_Form public function init() { - /* Form Elements & Other Definitions Here ... */ + $this->setName("Login"); + $this->setMethod('post'); + + $this->addElement('text', 'email', array( + 'filters' => array('StringTrim', 'StringToLower'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'E-Mail:', + )); + + $this->addElement('password', 'password', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Password:', + )); + + $this->addElement('submit', 'login', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Login', + )); } diff --git a/application/modules/user/forms/RecoverPassword.php b/application/modules/user/forms/RecoverPassword.php new file mode 100644 index 0000000..90feb87 --- /dev/null +++ b/application/modules/user/forms/RecoverPassword.php @@ -0,0 +1,28 @@ +setName("RecoverPassword"); + $this->setMethod('post'); + + $this->addElement('text', 'email', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 30)), + ), + 'required' => true, + 'label' => 'Email:', + )); + $this->addElement('submit', 'recoverPassword', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Recover Password', + )); + } + + +} + diff --git a/application/modules/user/forms/Register.php b/application/modules/user/forms/Register.php new file mode 100644 index 0000000..9c2a42d --- /dev/null +++ b/application/modules/user/forms/Register.php @@ -0,0 +1,105 @@ +setName("Register"); + $this->setMethod('post'); + + $this->addElement('text', 'title', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Title:', + )); + + + $this->addElement('text', 'name', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Name:', + )); + + $this->addElement('text', 'firstname', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Firstname:', + )); + + $this->addElement('text', 'street', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Street:', + )); + + $this->addElement('text', 'housenumber', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Housenumber:', + )); + + $this->addElement('text', 'city', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'City:', + )); + + $this->addElement('text', 'postalcode', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Postalcode:', + )); + + $this->addElement('text', 'email', array( + 'filters' => array('StringTrim', 'StringToLower'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Email:', + )); + + $this->addElement('password', 'password', array( + 'filters' => array('StringTrim'), + 'validators' => array( + array('StringLength', false, array(0, 50)), + ), + 'required' => true, + 'label' => 'Password:', + )); + + $this->addElement('submit', 'register', array( + 'required' => false, + 'ignore' => true, + 'label' => 'Register', + )); + + + } + + + +} + -- cgit v1.2.3-55-g7522