diff options
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 f58b6673f7f..16680be4aa0 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'); } @@ -553,6 +553,19 @@ class OC_User { return false; } + public static function userExistsForCreation($uid) { + foreach(self::$_usedBackends as $backend) { + if(!$backend->hasUserListings()) + continue; + + $result=$backend->userExists($uid); + if($result===true) { + return true; + } + } + return false; + } + /** * disables a user * @param string $userid the user to disable |