CC-3416 : Create password reset form
This commit is contained in:
parent
2c4df4853a
commit
102bcb1d46
18 changed files with 235 additions and 106 deletions
|
@ -9,6 +9,10 @@ class Application_Form_Login extends Zend_Form
|
|||
|
||||
// Set the method for the display form to POST
|
||||
$this->setMethod('post');
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/login.phtml'))
|
||||
));
|
||||
|
||||
// Add username element
|
||||
$this->addElement('text', 'username', array(
|
||||
|
@ -19,9 +23,12 @@ class Application_Form_Login extends Zend_Form
|
|||
'filters' => array('StringTrim'),
|
||||
'validators' => array(
|
||||
'NotEmpty',
|
||||
),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
// Add password element
|
||||
$this->addElement('password', 'password', array(
|
||||
'label' => 'Password:',
|
||||
|
@ -31,6 +38,9 @@ class Application_Form_Login extends Zend_Form
|
|||
'filters' => array('StringTrim'),
|
||||
'validators' => array(
|
||||
'NotEmpty',
|
||||
),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
|
@ -47,7 +57,10 @@ class Application_Form_Login extends Zend_Form
|
|||
$this->addElement('submit', 'submit', array(
|
||||
'ignore' => true,
|
||||
'label' => 'Login',
|
||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center'
|
||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,10 @@ class Application_Form_PasswordChange extends Zend_Form
|
|||
{
|
||||
public function init()
|
||||
{
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/password-change.phtml'))
|
||||
));
|
||||
|
||||
$this->addElement('password', 'password', array(
|
||||
'label' => 'Password',
|
||||
'required' => true,
|
||||
|
@ -13,10 +17,13 @@ class Application_Form_PasswordChange extends Zend_Form
|
|||
'validators' => array(
|
||||
array('stringLength', false, array(6, 80)),
|
||||
),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('password', 'password_confirm', array(
|
||||
'label' => 'Password Confirmation',
|
||||
'label' => 'Confirm new password',
|
||||
'required' => true,
|
||||
'filters' => array('stringTrim'),
|
||||
'validators' => array(
|
||||
|
@ -25,11 +32,18 @@ class Application_Form_PasswordChange extends Zend_Form
|
|||
}),
|
||||
),
|
||||
'errorMessages' => array("Password confirmation does not match your password."),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('submit', 'submit', array(
|
||||
'label' => 'Set password',
|
||||
'label' => 'Get new password',
|
||||
'ignore' => true,
|
||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,18 +6,28 @@ class Application_Form_PasswordRestore extends Zend_Form
|
|||
{
|
||||
public function init()
|
||||
{
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/password-restore.phtml'))
|
||||
));
|
||||
|
||||
$this->addElement('text', 'email', array(
|
||||
'label' => 'E-mail',
|
||||
'required' => true,
|
||||
'filters' => array(
|
||||
'stringTrim',
|
||||
),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('submit', 'submit', array(
|
||||
'label' => 'Restore password',
|
||||
'ignore' => true,
|
||||
'class' => 'ui-button ui-state-default'
|
||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue