libretime/airtime_mvc/application/forms/PasswordChange.php

50 lines
1.5 KiB
PHP
Raw Normal View History

<?php
/**
*/
class Application_Form_PasswordChange extends Zend_Form
{
public function init()
{
$this->setDecorators(array(
array('ViewScript', array('viewScript' => 'form/password-change.phtml'))
2012-04-17 18:16:10 +02: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'
)
));
$this->addElement('password', 'password_confirm', array(
2012-04-17 18:16:10 +02:00
'label' => 'Confirm new password',
'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'
)
));
$this->addElement('submit', 'submit', array(
2012-04-17 18:16:10 +02:00
'label' => 'Get new password',
'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'
)
));
}
}