[Pkg-owncloud-commits] [owncloud] 119/134: Remove limit and offset manipulation when getting users or groups, because it does not work when more than one user or group backend. Fixing it would be too costly performancewise, so we switch back to the model used in OC 5: limit and offset are effective per backend, and not a general constraint

David Prévot taffit at moszumanska.debian.org
Fri Apr 18 21:44:08 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 793f20d728152776fa4005340488081284b3f749
Author: Arthur Schiwon <blizzz at owncloud.com>
Date:   Tue Apr 15 17:46:48 2014 +0200

    Remove limit and offset manipulation when getting users or groups, because it does not work when more than one user or group backend. Fixing it would be too costly performancewise, so we switch back to the model used in OC 5: limit and offset are effective per backend, and not a general constraint
---
 lib/private/group/group.php   | 12 ------------
 lib/private/group/manager.php |  6 ------
 lib/private/user/manager.php  | 14 --------------
 3 files changed, 32 deletions(-)

diff --git a/lib/private/group/group.php b/lib/private/group/group.php
index bcd2419..d5a17f6 100644
--- a/lib/private/group/group.php
+++ b/lib/private/group/group.php
@@ -162,12 +162,6 @@ class Group {
 		$users = array();
 		foreach ($this->backends as $backend) {
 			$userIds = $backend->usersInGroup($this->gid, $search, $limit, $offset);
-			if (!is_null($limit)) {
-				$limit -= count($userIds);
-			}
-			if (!is_null($offset)) {
-				$offset -= count($userIds);
-			}
 			$users += $this->getVerifiedUsers($userIds);
 			if (!is_null($limit) and $limit <= 0) {
 				return array_values($users);
@@ -191,12 +185,6 @@ class Group {
 			} else {
 				$userIds = $backend->usersInGroup($this->gid, $search, $limit, $offset);
 			}
-			if (!is_null($limit)) {
-				$limit -= count($userIds);
-			}
-			if (!is_null($offset)) {
-				$offset -= count($userIds);
-			}
 			$users = $this->getVerifiedUsers($userIds);
 			if (!is_null($limit) and $limit <= 0) {
 				return array_values($users);
diff --git a/lib/private/group/manager.php b/lib/private/group/manager.php
index bf469d5..454e2b6 100644
--- a/lib/private/group/manager.php
+++ b/lib/private/group/manager.php
@@ -136,12 +136,6 @@ class Manager extends PublicEmitter {
 		$groups = array();
 		foreach ($this->backends as $backend) {
 			$groupIds = $backend->getGroups($search, $limit, $offset);
-			if (!is_null($limit)) {
-				$limit -= count($groupIds);
-			}
-			if (!is_null($offset)) {
-				$offset -= count($groupIds);
-			}
 			foreach ($groupIds as $groupId) {
 				$groups[$groupId] = $this->getGroupObject($groupId);
 			}
diff --git a/lib/private/user/manager.php b/lib/private/user/manager.php
index 90970ef..61abb00 100644
--- a/lib/private/user/manager.php
+++ b/lib/private/user/manager.php
@@ -175,13 +175,6 @@ class Manager extends PublicEmitter {
 			if (is_array($backendUsers)) {
 				foreach ($backendUsers as $uid) {
 					$users[] = $this->getUserObject($uid, $backend);
-					if (!is_null($limit)) {
-						$limit--;
-					}
-					if (!is_null($offset) and $offset > 0) {
-						$offset--;
-					}
-
 				}
 			}
 		}
@@ -211,13 +204,6 @@ class Manager extends PublicEmitter {
 			if (is_array($backendUsers)) {
 				foreach ($backendUsers as $uid => $displayName) {
 					$users[] = $this->getUserObject($uid, $backend);
-					if (!is_null($limit)) {
-						$limit--;
-					}
-					if (!is_null($offset) and $offset > 0) {
-						$offset--;
-					}
-
 				}
 			}
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list