Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/circles.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2018-09-09 18:12:59 +0300
committerMaxence Lange <maxence@artificial-owl.com>2018-09-09 18:12:59 +0300
commit28865bef20118ab7fdaca278118365842bb46204 (patch)
treeaf6a143eca2654b99109d98322989fb110c2cba4
parenta074da78a05c59f41f8d2c43d72a2eb2d8bc32b0 (diff)
should fix some LDAP setupv0.14.2
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r--lib/Service/MiscService.php12
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();
}