diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-07-18 12:15:34 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-07-18 12:15:34 +0200 |
commit | e3ea3ed3c563fce2b5fe1addfe199e3aaec7abdb (patch) | |
tree | 52fc58e3b1a46b1045223e869e83a7c104e97f21 /lib | |
parent | 63df8f350084c2e90419419e425697da8eff8a27 (diff) | |
download | nextcloud-server-e3ea3ed3c563fce2b5fe1addfe199e3aaec7abdb.tar.gz nextcloud-server-e3ea3ed3c563fce2b5fe1addfe199e3aaec7abdb.zip |
group: only pass backends that hold that specific group to the group constructor
Diffstat (limited to 'lib')
-rw-r--r-- | lib/group/group.php | 2 | ||||
-rw-r--r-- | lib/group/manager.php | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/group/group.php b/lib/group/group.php index d4036b4361b..7a639313247 100644 --- a/lib/group/group.php +++ b/lib/group/group.php @@ -225,7 +225,7 @@ class Group { $this->emitter->emit('\OC\Group', 'preDelete', array($this)); } foreach ($this->backends as $backend) { - if ($backend->implementsActions(OC_GROUP_BACKEND_DELETE_GROUP) and $backend->groupExists($this->gid)) { + if ($backend->implementsActions(OC_GROUP_BACKEND_DELETE_GROUP)) { $result = true; $backend->deleteGroup($this->gid); } diff --git a/lib/group/manager.php b/lib/group/manager.php index 7efcff0ade0..bf469d51d12 100644 --- a/lib/group/manager.php +++ b/lib/group/manager.php @@ -85,7 +85,13 @@ class Manager extends PublicEmitter { } protected function getGroupObject($gid) { - $this->cachedGroups[$gid] = new Group($gid, $this->backends, $this->userManager, $this); + $backends = array(); + foreach ($this->backends as $backend) { + if ($backend->groupExists($gid)) { + $backends[] = $backend; + } + } + $this->cachedGroups[$gid] = new Group($gid, $backends, $this->userManager, $this); return $this->cachedGroups[$gid]; } |