Skip to content

Commit 28865be

Browse files
committed
should fix some LDAP setup
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent a074da7 commit 28865be

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

lib/Service/MiscService.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,18 @@ public function success($data) {
130130
* @throws NoUserException
131131
*/
132132
public function getRealUserId($userId) {
133-
if (!$this->userManager->userExists($userId)) {
133+
if ($this->userManager->userExists($userId)) {
134+
return $this->userManager->get($userId)
135+
->getUID();
136+
}
137+
138+
$result = $this->userManager->search($userId);
139+
if (sizeof($result) !== 1) {
134140
throw new NoUserException();
135141
}
136142

137-
return $this->userManager->get($userId)
138-
->getUID();
143+
$user = array_shift($result);
144+
return $user->getUID();
139145
}
140146

141147

0 commit comments

Comments
 (0)