Commit 6d924c58 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #5261 If base detection fails, fall back to StringAttribute

Showing with 15 additions and 2 deletions
+15 -2
...@@ -113,8 +113,21 @@ class Step_Ldap extends setupStep ...@@ -113,8 +113,21 @@ class Step_Ldap extends setupStep
{ {
$attr = @LDAP::get_naming_contexts($this->connection); $attr = @LDAP::get_naming_contexts($this->connection);
unset($attr['count']); unset($attr['count']);
$this->attributesAccess['base']->setChoices($attr); if (count($attr)) {
$this->attributesAccess['admin']->attributes[1]->setValue(','.$this->base); if (!($this->attributesAccess['base'] instanceof SelectAttribute)) {
$this->attributesInfo['connection']['base'] = new SelectAttribute(
_('Base'), _('The LDAP directory base'),
'base', TRUE
);
}
$this->attributesAccess['base']->setChoices($attr);
$this->attributesAccess['admin']->attributes[1]->setValue(','.$this->base);
} else {
$this->attributesInfo['connection']['base'] = new StringAttribute(
_('Base'), _('The LDAP directory base'),
'base', TRUE
);
}
} }
function save_object() function save_object()
......
  • bmortier @bmortier

    mentioned in issue #1668

    By tbp on 2017-09-02T15:34:21 (imported from GitLab)

    ·

    mentioned in issue #1668

    By tbp on 2017-09-02T15:34:21 (imported from GitLab)

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment