mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
SecurityConfigForm: if protected_customvars is not set at all, display suggestion as placeholder
refs #2767
This commit is contained in:
parent
b0221c5e13
commit
9a79b194dd
@ -52,7 +52,7 @@ class SecurityConfigForm extends ConfigForm
|
|||||||
'protected_customvars',
|
'protected_customvars',
|
||||||
array(
|
array(
|
||||||
'allowEmpty' => true,
|
'allowEmpty' => true,
|
||||||
'value' => '*pw*,*pass*,community',
|
'attribs' => array('placeholder' => $this->getDefaultProtectedCustomvars()),
|
||||||
'label' => $this->translate('Protected Custom Variables'),
|
'label' => $this->translate('Protected Custom Variables'),
|
||||||
'description' => $this->translate(
|
'description' => $this->translate(
|
||||||
'Comma separated case insensitive list of protected custom variables.'
|
'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';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,5 +22,6 @@ class SecurityPage extends Form
|
|||||||
$securityConfigForm = new SecurityConfigForm();
|
$securityConfigForm = new SecurityConfigForm();
|
||||||
$securityConfigForm->createElements($formData);
|
$securityConfigForm->createElements($formData);
|
||||||
$this->addElements($securityConfigForm->getElements());
|
$this->addElements($securityConfigForm->getElements());
|
||||||
|
$this->getElement('protected_customvars')->setValue($securityConfigForm->getDefaultProtectedCustomvars());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user