2011-12-22 01:01:29 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
class Application_Form_PasswordChange extends Zend_Form
|
|
|
|
{
|
|
|
|
public function init()
|
|
|
|
{
|
2012-08-29 05:04:55 +02:00
|
|
|
$this->setDecorators(array(
|
|
|
|
array('ViewScript', array('viewScript' => 'form/password-change.phtml'))
|
2012-04-17 18:16:10 +02:00
|
|
|
));
|
2012-07-11 00:55:44 +02:00
|
|
|
|
2011-12-22 01:01:29 +01:00
|
|
|
$this->addElement('password', 'password', array(
|
|
|
|
'label' => 'Password',
|
|
|
|
'required' => true,
|
|
|
|
'filters' => array('stringTrim'),
|
|
|
|
'validators' => array(
|
|
|
|
array('stringLength', false, array(6, 80)),
|
|
|
|
),
|
2012-04-17 18:16:10 +02:00
|
|
|
'decorators' => array(
|
|
|
|
'ViewHelper'
|
|
|
|
)
|
2011-12-22 01:01:29 +01:00
|
|
|
));
|
|
|
|
|
|
|
|
$this->addElement('password', 'password_confirm', array(
|
2012-04-17 18:16:10 +02:00
|
|
|
'label' => 'Confirm new password',
|
2011-12-22 01:01:29 +01:00
|
|
|
'required' => true,
|
|
|
|
'filters' => array('stringTrim'),
|
|
|
|
'validators' => array(
|
|
|
|
new Zend_Validate_Callback(function ($value, $context) {
|
|
|
|
return $value == $context['password'];
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
'errorMessages' => array("Password confirmation does not match your password."),
|
2012-04-17 18:16:10 +02:00
|
|
|
'decorators' => array(
|
|
|
|
'ViewHelper'
|
|
|
|
)
|
2011-12-22 01:01:29 +01:00
|
|
|
));
|
|
|
|
|
|
|
|
$this->addElement('submit', 'submit', array(
|
2012-04-17 18:16:10 +02:00
|
|
|
'label' => 'Get new password',
|
2011-12-22 01:01:29 +01:00
|
|
|
'ignore' => true,
|
2012-04-17 18:16:10 +02:00
|
|
|
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
|
|
|
'decorators' => array(
|
|
|
|
'ViewHelper'
|
|
|
|
)
|
2011-12-22 01:01:29 +01:00
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|