From 14204394033f50625f252bdf4907e770c71c80fb Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 6 Aug 2020 15:11:41 +0200 Subject: [PATCH] LScli: fix autocomplete_LSobject_types() in case of configured subDn --- src/includes/class/class.LScli.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/includes/class/class.LScli.php b/src/includes/class/class.LScli.php index 65a847c2..0166efd4 100644 --- a/src/includes/class/class.LScli.php +++ b/src/includes/class/class.LScli.php @@ -599,18 +599,17 @@ 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) - if (!in_array($type, $types)) - $types[] = $type; - } - else { - foreach ($value as $objConfig) - if (is_array($objConfig) && isset($objConfig['LSobjets']) && is_array($objConfig['LSobjects'])) + 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 if (isset($value['LSobjects']) && is_array($value['LSobjects'])) { + foreach ($value['LSobjects'] as $type) + if (!in_array($type, $types)) + $types[] = $type; + } } } return self :: autocomplete_opts($types, $prefix, $case_sensitive, $quote_char);