[icinga-checkins] icinga.org: icingaweb2/bugfix/ group_name_attribute-should-be-sAMAccountName-by-default-12295: Use default values while validating user backend

git at icinga.org git at icinga.org
Tue Dec 20 11:34:13 CET 2016


Module: icingaweb2
Branch: bugfix/group_name_attribute-should-be-sAMAccountName-by-default-12295
Commit: 69eaaec512cecca2782e6a2bf4788eeea2590d14
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=69eaaec512cecca2782e6a2bf4788eeea2590d14

Author: Noah Hilverling <noah.hilverling at netways.de>
Date:   Tue Dec 20 11:33:46 2016 +0100

Use default values while validating user backend

refs #12295

---

 application/forms/Config/UserBackendConfigForm.php |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/application/forms/Config/UserBackendConfigForm.php b/application/forms/Config/UserBackendConfigForm.php
index f7d4d15..7555cdb 100644
--- a/application/forms/Config/UserBackendConfigForm.php
+++ b/application/forms/Config/UserBackendConfigForm.php
@@ -354,7 +354,14 @@ class UserBackendConfigForm extends ConfigForm
      */
     public static function inspectUserBackend(Form $form)
     {
-        $backend = UserBackend::create(null, new ConfigObject($form->getValues()));
+        $values = array_filter($form->getValues(),
+            function($v) {
+                if ($v || $v === 0 || $v === '0') {
+                    return $v;
+                }
+            }
+        );
+        $backend = UserBackend::create(null, new ConfigObject($values));
         if ($backend instanceof Inspectable) {
             return $backend->inspect();
         }



More information about the icinga-checkins mailing list