Skip to content

Commit

Permalink
LdapUserGroupBackendForm: Do not disable base_dn' and user_base_dn'
Browse files Browse the repository at this point in the history
refs #7343
  • Loading branch information
Johannes Meyer committed Jun 5, 2015
1 parent 797e9de commit e910a5a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions application/forms/Config/UserGroup/LdapUserGroupBackendForm.php
Expand Up @@ -76,6 +76,7 @@ public function createElements(array $formData)
$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(
Expand All @@ -84,11 +85,11 @@ public function createElements(array $formData)
'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);
}

/**
Expand Down Expand Up @@ -161,7 +162,6 @@ protected function createGroupConfigElements(ConfigObject $defaults, $disabled)
'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 ' .
Expand All @@ -177,8 +177,9 @@ protected function createGroupConfigElements(ConfigObject $defaults, $disabled)
*
* @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',
Expand Down Expand Up @@ -242,7 +243,7 @@ protected function createUserConfigElements(ConfigObject $defaults, $disabled)
'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 ' .
Expand Down

0 comments on commit e910a5a

Please sign in to comment.