From e910a5a254ba834d7db01925d0e259d21b57ced3 Mon Sep 17 00:00:00 2001
From: Johannes Meyer <johannes.meyer@netways.de>
Date: Fri, 5 Jun 2015 16:16:35 +0200
Subject: [PATCH] LdapUserGroupBackendForm: Do not disable `base_dn' and
 `user_base_dn'

refs #7343
---
 .../Config/UserGroup/LdapUserGroupBackendForm.php     | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php b/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php
index 3e97f4dd4..5b6d42b89 100644
--- a/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php
+++ b/application/forms/Config/UserGroup/LdapUserGroupBackendForm.php
@@ -76,6 +76,7 @@ class LdapUserGroupBackendForm extends Form
             $groupConfigDisabled = $userConfigDisabled = true;
         }
 
+        $dnDisabled = null; // MUST BE null
         if (isset($formData['user_backend']) && $formData['user_backend'] !== 'none') {
             $userBackend = UserBackend::create($formData['user_backend']);
             $defaults->merge(array(
@@ -84,11 +85,11 @@ class LdapUserGroupBackendForm extends Form
                 'user_name_attribute'   => $userBackend->getUserNameAttribute(),
                 'user_filter'           => $userBackend->getFilter()
             ));
-            $userConfigDisabled = true;
+            $userConfigDisabled = $dnDisabled = true;
         }
 
         $this->createGroupConfigElements($defaults, $groupConfigDisabled);
-        $this->createUserConfigElements($defaults, $userConfigDisabled);
+        $this->createUserConfigElements($defaults, $userConfigDisabled, $dnDisabled);
     }
 
     /**
@@ -161,7 +162,6 @@ class LdapUserGroupBackendForm extends Form
             'base_dn',
             array(
                 'preserveDefault'   => true,
-                'disabled'          => $disabled,
                 'label'             => $this->translate('LDAP Group Base DN'),
                 'description'       => $this->translate(
                     'The path where groups can be found on the LDAP server. Leave ' .
@@ -177,8 +177,9 @@ class LdapUserGroupBackendForm extends Form
      *
      * @param   ConfigObject    $defaults
      * @param   null|bool       $disabled
+     * @param   null|bool       $dnDisabled
      */
-    protected function createUserConfigElements(ConfigObject $defaults, $disabled)
+    protected function createUserConfigElements(ConfigObject $defaults, $disabled, $dnDisabled)
     {
         $this->addElement(
             'text',
@@ -242,7 +243,7 @@ class LdapUserGroupBackendForm extends Form
             'user_base_dn',
             array(
                 'preserveDefault'   => true,
-                'disabled'          => $disabled,
+                'disabled'          => $dnDisabled,
                 'label'             => $this->translate('LDAP User Base DN'),
                 'description'       => $this->translate(
                     'The path where users can be found on the LDAP server. Leave ' .