Skip to content

Commit 00ea721

Browse files
committed
When expanding the tree, some LDAP servers return hasSubordinates in lower case (eg: opendj) and some dont return it at all, but does return numSubordinates (eg: 389ds). #396
1 parent b27637d commit 00ea721

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/Http/Controllers/AjaxController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,15 @@ public function children(Request $request): Collection
4646

4747
Log::debug(sprintf('%s:Query [%s]',self::LOGKEY,$dn));
4848

49-
return (config('server'))
49+
return config('server')
5050
->children($dn)
5151
->transform(fn($item)=>
5252
[
5353
'title'=>$item->getRdn(),
5454
'item'=>$item->getDNSecure(),
5555
'icon'=>$item->icon(),
56-
'lazy'=>Arr::get($item->getAttribute('hassubordinates'),0) == 'TRUE',
56+
'lazy'=>(strcasecmp(Arr::get($item->getAttribute('hassubordinates'),0),'TRUE') === 0)
57+
|| Arr::get($item->getAttribute('numsubordinates'),0),
5758
'tooltip'=>$item->getDn(),
5859
])
5960
->prepend(

0 commit comments

Comments
 (0)