LScli: fix autocomplete_LSobject_types() in case of configured subDn

This commit is contained in:
Benjamin Renard 2020-08-06 15:11:41 +02:00
parent 712d18b09f
commit 1420439403

View file

@ -599,15 +599,14 @@ class LScli extends LSlog_staticLoggerClass {
foreach ($subdn_config as $key => $value) {
if (!is_array($value)) continue;
if ($key == 'LSobject') {
if (isset($value['LSobjects']) && is_array($value['LSobjects']))
foreach ($value['LSobjects'] as $type)
foreach ($value as $subDnObjType => $objConfig)
if (is_array($objConfig) && isset($objConfig['LSobjects']) && is_array($objConfig['LSobjects']))
foreach ($objConfig['LSobjects'] as $type)
if (!in_array($type, $types))
$types[] = $type;
}
else {
foreach ($value as $objConfig)
if (is_array($objConfig) && isset($objConfig['LSobjets']) && is_array($objConfig['LSobjects']))
foreach ($objConfig['LSobjects'] as $type)
else if (isset($value['LSobjects']) && is_array($value['LSobjects'])) {
foreach ($value['LSobjects'] as $type)
if (!in_array($type, $types))
$types[] = $type;
}