SecurityConfigForm: if protected_customvars is not set at all, display suggestion as placeholder

refs #2767
This commit is contained in:
Alexander A. Klimov 2017-02-23 12:52:47 +01:00
parent b0221c5e13
commit 9a79b194dd
2 changed files with 12 additions and 1 deletions

View File

@ -52,7 +52,7 @@ class SecurityConfigForm extends ConfigForm
'protected_customvars',
array(
'allowEmpty' => true,
'value' => '*pw*,*pass*,community',
'attribs' => array('placeholder' => $this->getDefaultProtectedCustomvars()),
'label' => $this->translate('Protected Custom Variables'),
'description' => $this->translate(
'Comma separated case insensitive list of protected custom variables.'
@ -62,4 +62,14 @@ class SecurityConfigForm extends ConfigForm
)
);
}
/**
* Return the customvars to suggest to protect when none are protected
*
* @return string
*/
public function getDefaultProtectedCustomvars()
{
return '*pw*,*pass*,community';
}
}

View File

@ -22,5 +22,6 @@ class SecurityPage extends Form
$securityConfigForm = new SecurityConfigForm();
$securityConfigForm->createElements($formData);
$this->addElements($securityConfigForm->getElements());
$this->getElement('protected_customvars')->setValue($securityConfigForm->getDefaultProtectedCustomvars());
}
}