Skip to content

Commit 8072fde

Browse files
author
robin.kluth
committed
1.1.14
* Provide domainName for searched users - only if needed (more than 1 domain configured)
1 parent 03b4464 commit 8072fde

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/LdapAuth.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,12 @@ public function searchUser($searchFor, $attributes = "", $searchFilter = "", $au
264264
continue;
265265
}
266266
$sid = self::SIDtoString($entry['objectsid'][0]);
267-
array_push($return, array_merge(['sid' => $sid, 'dn' => $entry['dn'], 'domainKey' => $i, 'domainName' => $this->domains[$i]['name']], self::handleEntry($entry)));
267+
$additionalData = ['sid' => $sid, 'dn' => $entry['dn'], 'domainKey' => $i];
268+
if (count($this->domains) > 1) {
269+
// Enable domainName output if more than one domains configured
270+
$additionalData['domainName'] = $this->domains[$i]['name'];
271+
}
272+
array_push($return, array_merge($additionalData, self::handleEntry($entry)));
268273
}
269274
}
270275
$i++;

0 commit comments

Comments
 (0)