CC-3667 : Preferences pages should have an option to enable/disable password recovery option

This commit is contained in:
Naomi Aro 2012-04-25 12:50:21 +02:00
parent 4cdfd33044
commit 439ebb1128
1 changed files with 17 additions and 10 deletions

View File

@ -84,16 +84,23 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
->setFilters(array('StringTrim'))
->setValidators(array(
'NotEmpty',
'EmailAddress',
new Zend_Validate_Callback(function ($value, $context) {
if ($context['enableSystemEmail']) {
return true;
}
return false;
})
))
->setDecorators(array('ViewHelper'));
'EmailAddress'
))
->setDecorators(array('ViewHelper'));
$systemEmail->addValidator('Callback', true, array(
'callback' => function($value, $context) {
if ($context['enableSystemEmail']) {
return true;
}
return false;
},
'messages' => array(
Zend_Validate_Callback::INVALID_VALUE => 'Email must be enabled'
),
));
$this->addElement($systemEmail);
}