[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
Wed Jan 11 11:04:15 CET 2017


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

Author: Noah Hilverling <noah.hilverling at netways.de>
Date:   Mon Jan  9 16:56:18 2017 +0100

Use default values while validating user backend

refs #12295

---

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

diff --git a/application/forms/Config/UserBackendConfigForm.php b/application/forms/Config/UserBackendConfigForm.php
index f7d4d15..4f8d714 100644
--- a/application/forms/Config/UserBackendConfigForm.php
+++ b/application/forms/Config/UserBackendConfigForm.php
@@ -354,7 +354,12 @@ 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) {
+                return $v || $v === 0 || $v === '0';
+            }
+        );
+        $backend = UserBackend::create(null, new ConfigObject($values));
         if ($backend instanceof Inspectable) {
             return $backend->inspect();
         }



More information about the icinga-checkins mailing list