summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-17 10:31:33 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-24 09:53:36 +0100
commit4c738ea9c47686e35ff6ad3e4617446849dca3c0 (patch)
treecc6fe1e883a7f7abeecba910157be4b61bdab8fc
parent4b3af9dfe781dc875f3bf94cd31e658ef1d707a9 (diff)
downloadnextcloud-server-4c738ea9c47686e35ff6ad3e4617446849dca3c0.tar.gz
nextcloud-server-4c738ea9c47686e35ff6ad3e4617446849dca3c0.zip
Fix group shares on v1 caldav and carddav - fixes #23328
-rw-r--r--apps/dav/lib/caldav/caldavbackend.php3
-rw-r--r--apps/dav/lib/carddav/carddavbackend.php2
-rw-r--r--apps/dav/lib/connector/sabre/principal.php4
3 files changed, 5 insertions, 4 deletions
diff --git a/apps/dav/lib/caldav/caldavbackend.php b/apps/dav/lib/caldav/caldavbackend.php
index bb50100d9a2..79bbcefaab1 100644
--- a/apps/dav/lib/caldav/caldavbackend.php
+++ b/apps/dav/lib/caldav/caldavbackend.php
@@ -138,6 +138,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @return array
*/
function getCalendarsForUser($principalUri) {
+ $principalUriOriginal = $principalUri;
$principalUri = $this->convertPrincipal($principalUri, true);
$fields = array_values($this->propertyMap);
$fields[] = 'id';
@@ -184,7 +185,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
$stmt->closeCursor();
// query for shared calendars
- $principals = $this->principalBackend->getGroupMembership($principalUri);
+ $principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true);
$principals[]= $principalUri;
$fields = array_values($this->propertyMap);
diff --git a/apps/dav/lib/carddav/carddavbackend.php b/apps/dav/lib/carddav/carddavbackend.php
index bfb6ea82ad7..ccf0f4fbe06 100644
--- a/apps/dav/lib/carddav/carddavbackend.php
+++ b/apps/dav/lib/carddav/carddavbackend.php
@@ -126,7 +126,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
$result->closeCursor();
// query for shared calendars
- $principals = $this->principalBackend->getGroupMembership($principalUri);
+ $principals = $this->principalBackend->getGroupMembership($principalUri, true);
$principals[]= $principalUri;
$query = $this->db->getQueryBuilder();
diff --git a/apps/dav/lib/connector/sabre/principal.php b/apps/dav/lib/connector/sabre/principal.php
index 31de4e5bad1..49fb4efdee2 100644
--- a/apps/dav/lib/connector/sabre/principal.php
+++ b/apps/dav/lib/connector/sabre/principal.php
@@ -135,7 +135,7 @@ class Principal implements BackendInterface {
* @return array
* @throws Exception
*/
- public function getGroupMembership($principal) {
+ public function getGroupMembership($principal, $needGroups = false) {
list($prefix, $name) = URLUtil::splitPath($principal);
if ($prefix === $this->principalPrefix) {
@@ -144,7 +144,7 @@ class Principal implements BackendInterface {
throw new Exception('Principal not found');
}
- if ($this->hasGroups) {
+ if ($this->hasGroups || $needGroups) {
$groups = $this->groupManager->getUserGroups($user);
$groups = array_map(function($group) {
/** @var IGroup $group */