CC-3667 : Preferences pages should have an option to enable/disable password recovery option
This commit is contained in:
parent
8020ae0a29
commit
4cdfd33044
|
@ -65,6 +65,16 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
$week_start_day->setDecorators(array('ViewHelper'));
|
$week_start_day->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($week_start_day);
|
$this->addElement($week_start_day);
|
||||||
|
|
||||||
|
//enable system emails.
|
||||||
|
$this->addElement('checkbox', 'enableSystemEmail', array(
|
||||||
|
'label' => 'Enable System Emails (Password Reset)',
|
||||||
|
'required' => false,
|
||||||
|
'value' => Application_Model_Preference::GetEnableSystemEmail(),
|
||||||
|
'decorators' => array(
|
||||||
|
'ViewHelper'
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
// Add end date element
|
// Add end date element
|
||||||
$systemEmail = new Zend_Form_Element_Text('systemEmail');
|
$systemEmail = new Zend_Form_Element_Text('systemEmail');
|
||||||
$systemEmail->class = 'input_text';
|
$systemEmail->class = 'input_text';
|
||||||
|
@ -74,7 +84,14 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||||
->setFilters(array('StringTrim'))
|
->setFilters(array('StringTrim'))
|
||||||
->setValidators(array(
|
->setValidators(array(
|
||||||
'NotEmpty',
|
'NotEmpty',
|
||||||
'EmailAddress'
|
'EmailAddress',
|
||||||
|
new Zend_Validate_Callback(function ($value, $context) {
|
||||||
|
if ($context['enableSystemEmail']) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
})
|
||||||
))
|
))
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($systemEmail);
|
$this->addElement($systemEmail);
|
||||||
|
|
|
@ -789,6 +789,14 @@ class Application_Model_Preference
|
||||||
return self::GetValue("live_dj_source_connection_url");
|
return self::GetValue("live_dj_source_connection_url");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function SetEnableSystemEmail($upload) {
|
||||||
|
self::SetValue("enable_system_email", $upload);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetEnableSystemEmail() {
|
||||||
|
return self::GetValue("enable_system_email");
|
||||||
|
}
|
||||||
|
|
||||||
public static function SetSystemEmail($value) {
|
public static function SetSystemEmail($value) {
|
||||||
self::SetValue("system_email", $value, false);
|
self::SetValue("system_email", $value, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,22 @@
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
<!-- Enable System Email option -->
|
||||||
|
<dt id="enableSystemEmail-label" class="block-display">
|
||||||
|
<label class="required" for="timezone"><?php echo $this->element->getElement('enableSystemEmail')->getLabel() ?>:
|
||||||
|
</label>
|
||||||
|
</dt>
|
||||||
|
<dd id="enableSystemEmail-element" class="block-display">
|
||||||
|
<?php echo $this->element->getElement('enableSystemEmail') ?>
|
||||||
|
<?php if($this->element->getElement('enableSystemEmail')->hasErrors()) : ?>
|
||||||
|
<ul class='errors'>
|
||||||
|
<?php foreach($this->element->getElement('enableSystemEmail')->getMessages() as $error): ?>
|
||||||
|
<li><?php echo $error; ?></li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
</dd>
|
||||||
|
|
||||||
<!-- System Email option -->
|
<!-- System Email option -->
|
||||||
<dt id="systemEmail-label" class="block-display">
|
<dt id="systemEmail-label" class="block-display">
|
||||||
<label class="required" for="timezone"><?php echo $this->element->getElement('systemEmail')->getLabel() ?>:
|
<label class="required" for="timezone"><?php echo $this->element->getElement('systemEmail')->getLabel() ?>:
|
||||||
|
|
Loading…
Reference in New Issue