]> source.dussan.org Git - nextcloud-server.git/commitdiff
LDAP plugin: force createUser to return new user's DN 14778/head
authorVinicius Cubas Brand <viniciuscb@gmail.com>
Thu, 14 Mar 2019 14:59:27 +0000 (11:59 -0300)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 21 Mar 2019 09:20:46 +0000 (10:20 +0100)
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>
apps/user_ldap/lib/User_LDAP.php

index 855c13e13fba65cd23741f1f7cee8dda83126ba7..e69eafecc86db66086adebc6509f58fe11d8680c 100644 (file)
@@ -615,6 +615,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
         * create new user
         * @param string $username username of the new user
         * @param string $password password of the new user
+        * @throws \UnexpectedValueException
         * @return bool
         */
        public function createUser($username, $password) {
@@ -624,7 +625,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
                                        //updates user mapping
                                        $this->access->dn2ocname($dn, $username, true);
                                } 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;