diff options
author | Joas Schilling <coding@schilljs.com> | 2017-06-20 19:59:41 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-06-20 19:59:41 +0200 |
commit | b726204f917afc0faca7d44dfdbb4b2c5fb3f585 (patch) | |
tree | 7b9ab2aa7bb0593760271322f71edaf31e8b83e2 /lib/private | |
parent | b556c4855cdaf7a939b29c1c5b78f0b0dc8bb6a8 (diff) | |
download | nextcloud-server-b726204f917afc0faca7d44dfdbb4b2c5fb3f585.tar.gz nextcloud-server-b726204f917afc0faca7d44dfdbb4b2c5fb3f585.zip |
Create users in non default backends first
Most of the time, when people have multiple backends or add a
custom backend, they want to create the users there and not in
the default backend. But since that is registered first, users
were always created there.
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/User/Manager.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/private/User/Manager.php b/lib/private/User/Manager.php index 0477f23e552..c04f426c2cf 100644 --- a/lib/private/User/Manager.php +++ b/lib/private/User/Manager.php @@ -284,7 +284,20 @@ class Manager extends PublicEmitter implements IUserManager { * @return bool|IUser the created user or false */ public function createUser($uid, $password) { + $localBackends = []; foreach ($this->backends as $backend) { + if ($backend instanceof Database) { + // First check if there is another user backend + $localBackends[] = $backend; + continue; + } + + if ($backend->implementsActions(Backend::CREATE_USER)) { + return $this->createUserFromBackend($uid, $password, $backend); + } + } + + foreach ($localBackends as $backend) { if ($backend->implementsActions(Backend::CREATE_USER)) { return $this->createUserFromBackend($uid, $password, $backend); } |