CC-3667 : Preferences pages should have an option to enable/disable password recovery option
This commit is contained in:
parent
4cdfd33044
commit
439ebb1128
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue