From 9a79b194dde6050f7ba68560c829915615c0655e Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 23 Feb 2017 12:52:47 +0100 Subject: [PATCH 1/2] SecurityConfigForm: if protected_customvars is not set at all, display suggestion as placeholder refs #2767 --- .../application/forms/Config/SecurityConfigForm.php | 12 +++++++++++- .../application/forms/Setup/SecurityPage.php | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/application/forms/Config/SecurityConfigForm.php b/modules/monitoring/application/forms/Config/SecurityConfigForm.php index 2dfd810ee..8081b9316 100644 --- a/modules/monitoring/application/forms/Config/SecurityConfigForm.php +++ b/modules/monitoring/application/forms/Config/SecurityConfigForm.php @@ -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'; + } } diff --git a/modules/monitoring/application/forms/Setup/SecurityPage.php b/modules/monitoring/application/forms/Setup/SecurityPage.php index 85bb7bda7..999103c8b 100644 --- a/modules/monitoring/application/forms/Setup/SecurityPage.php +++ b/modules/monitoring/application/forms/Setup/SecurityPage.php @@ -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()); } } From a0917148e8e28610dfe314480644207be407f827 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 23 Feb 2017 12:53:56 +0100 Subject: [PATCH 2/2] CSS: make text of input.placeholder and input.value differentiable refs #2767 Signed-off-by: Eric Lippmann --- public/css/icinga/forms.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/css/icinga/forms.less b/public/css/icinga/forms.less index 0ac312314..ca1758888 100644 --- a/public/css/icinga/forms.less +++ b/public/css/icinga/forms.less @@ -36,21 +36,21 @@ input[type="submit"] { } input:-moz-placeholder { // FF 18- - color: inherit; + color: @gray-light; opacity: 1; } input::-moz-placeholder { // FF 19+ - color: inherit; + color: @gray-light; opacity: 1; } input:-ms-input-placeholder { - color: inherit; + color: @gray-light; } input::-webkit-input-placeholder { - color: inherit; + color: @gray-light; } input.search {