summaryrefslogtreecommitdiffstats
path: root/lib/user.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-02-13 12:59:30 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2013-02-13 12:59:30 -0800
commite1e77fe3be90563e6389a6a3d1fac7b6028d0bd0 (patch)
tree90df67718f91a99ec13c30cf583fd5f438bb749c /lib/user.php
parent6d7e324f4b97b86199c1e3097a0f9494945f3cb9 (diff)
parent9d6f74c65eb51b88e6d93c85a725fbaac2ed8e4a (diff)
downloadnextcloud-server-e1e77fe3be90563e6389a6a3d1fac7b6028d0bd0.tar.gz
nextcloud-server-e1e77fe3be90563e6389a6a3d1fac7b6028d0bd0.zip
Merge pull request #1598 from owncloud/fixing-1424-master
Fixing 1424 master
Diffstat (limited to 'lib/user.php')
-rw-r--r--lib/user.php15
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