diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-02-08 17:16:18 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-02-08 17:16:18 +0100 |
commit | 05b46f78281e5df49a5c6a0513a37eaf03c3c29d (patch) | |
tree | 66be0588d54982d30c1909f7bc8cd8fe8918eb7f /lib/user.php | |
parent | 96042f1e5b343ed75f59fc2997b7e54c07b557da (diff) | |
download | nextcloud-server-05b46f78281e5df49a5c6a0513a37eaf03c3c29d.tar.gz nextcloud-server-05b46f78281e5df49a5c6a0513a37eaf03c3c29d.zip |
on creation only test for existing users if the backend supports user creation
this solves the issue where no users can be created any more if backends are active which always return true on userExists() like WebDAV Auth
Diffstat (limited to 'lib/user.php')
-rw-r--r-- | lib/user.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/user.php b/lib/user.php index 9dc8cca97a6..76c4c45ee30 100644 --- a/lib/user.php +++ b/lib/user.php @@ -172,7 +172,7 @@ class OC_User { } // Check if user already exists - if( self::userExists($uid) ) { + if( self::userExistsForCreation($uid) ) { throw new Exception('The username is already being used'); } @@ -551,6 +551,19 @@ class OC_User { return false; } + public static function userExistsForCreation($uid) { + foreach(self::$_usedBackends as $backend) { + if(!$backend->implementsActions(OC_USER_BACKEND_CREATE_USER)) + continue; + + $result=$backend->userExists($uid); + if($result===true) { + return true; + } + } + return false; + } + /** * disables a user * @param string $userid the user to disable |