Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-02-08 20:16:18 +0400
committerThomas Müller <thomas.mueller@tmit.eu>2013-02-08 20:16:18 +0400
commit05b46f78281e5df49a5c6a0513a37eaf03c3c29d (patch)
tree66be0588d54982d30c1909f7bc8cd8fe8918eb7f /lib/user.php
parent96042f1e5b343ed75f59fc2997b7e54c07b557da (diff)
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.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