diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2018-09-09 18:12:59 +0300 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2018-09-09 18:12:59 +0300 |
commit | 28865bef20118ab7fdaca278118365842bb46204 (patch) | |
tree | af6a143eca2654b99109d98322989fb110c2cba4 | |
parent | a074da78a05c59f41f8d2c43d72a2eb2d8bc32b0 (diff) |
should fix some LDAP setupv0.14.2
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r-- | lib/Service/MiscService.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Service/MiscService.php b/lib/Service/MiscService.php index 27765c1b..5087fa73 100644 --- a/lib/Service/MiscService.php +++ b/lib/Service/MiscService.php @@ -130,12 +130,18 @@ class MiscService { * @throws NoUserException */ public function getRealUserId($userId) { - if (!$this->userManager->userExists($userId)) { + if ($this->userManager->userExists($userId)) { + return $this->userManager->get($userId) + ->getUID(); + } + + $result = $this->userManager->search($userId); + if (sizeof($result) !== 1) { throw new NoUserException(); } - return $this->userManager->get($userId) - ->getUID(); + $user = array_shift($result); + return $user->getUID(); } |