diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-06-14 17:20:42 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-06-19 17:02:28 +0200 |
commit | 660fbd64e34fccb26f1a38d1b67da5618e624875 (patch) | |
tree | c7e83a93c4a8565913097204b17461dde2e5c025 /apps/user_ldap/lib/User_LDAP.php | |
parent | 5b754a6353d31f0548860f1b17b7c9db0f2ee791 (diff) | |
download | nextcloud-server-660fbd64e34fccb26f1a38d1b67da5618e624875.tar.gz nextcloud-server-660fbd64e34fccb26f1a38d1b67da5618e624875.zip |
ensures mapping of chosen userid
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib/User_LDAP.php')
-rw-r--r-- | apps/user_ldap/lib/User_LDAP.php | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php index ada07aa53a9..5e06547533d 100644 --- a/apps/user_ldap/lib/User_LDAP.php +++ b/apps/user_ldap/lib/User_LDAP.php @@ -622,8 +622,26 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn if ($this->userPluginManager->implementsActions(Backend::CREATE_USER)) { if ($dn = $this->userPluginManager->createUser($username, $password)) { if (is_string($dn)) { - //updates user mapping - $this->access->dn2ocname($dn, $username, true); + // the NC user creation work flow requires a know user id up front + $uuid = $this->access->getUUID($dn, true); + if(is_string($uuid)) { + $this->access->mapAndAnnounceIfApplicable( + $this->access->getUserMapper(), + $dn, + $username, + $uuid, + true + ); + $this->access->cacheUserExists($username); + } else { + \OC::$server->getLogger()->warning( + 'Failed to map created LDAP user with userid {userid}, because UUID could not be determined', + [ + 'app' => 'user_ldap', + 'userid' => $username, + ] + ); + } } else { throw new \UnexpectedValueException("LDAP Plugin: Method createUser changed to return the user DN instead of boolean."); } |