summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/user.php15
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