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

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

parent 2a7c9c29
......@@ -113,8 +113,21 @@ class Step_Ldap extends setupStep
{
$attr = @LDAP::get_naming_contexts($this->connection);
unset($attr['count']);
$this->attributesAccess['base']->setChoices($attr);
$this->attributesAccess['admin']->attributes[1]->setValue(','.$this->base);
if (count($attr)) {
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()
......
Markdown is supported
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