LDAP plugin: force createUser to return new user's DN

LDAP plugins must change the createUser method to return the DN, as we
need this to update the cache.

Signed-off-by: Vinicius Cubas Brand <viniciuscb@gmail.com>
This commit is contained in:
Vinicius Cubas Brand 2019-03-14 11:59:27 -03:00 committed by Morris Jobke
parent a2c38148e7
commit 61572a5b2e
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 2 additions and 1 deletions

View File

@ -615,6 +615,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
* create new user * create new user
* @param string $username username of the new user * @param string $username username of the new user
* @param string $password password of the new user * @param string $password password of the new user
* @throws \UnexpectedValueException
* @return bool * @return bool
*/ */
public function createUser($username, $password) { public function createUser($username, $password) {
@ -624,7 +625,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
//updates user mapping //updates user mapping
$this->access->dn2ocname($dn, $username, true); $this->access->dn2ocname($dn, $username, true);
} else { } else {
throw new \Exception("LDAP Plugin: Method createUser changed to return the user DN instead of boolean."); throw new \UnexpectedValueException("LDAP Plugin: Method createUser changed to return the user DN instead of boolean.");
} }
} }
return (bool) $dn; return (bool) $dn;