Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
4c738ea9
Commit
4c738ea9
authored
Mar 17, 2016
by
Thomas Müller
Browse files
Fix group shares on v1 caldav and carddav - fixes #23328
parent
4b3af9df
Changes
3
Hide whitespace changes
Inline
Side-by-side
apps/dav/lib/caldav/caldavbackend.php
View file @
4c738ea9
...
...
@@ -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
(
$principalUri
Original
,
true
);
$principals
[]
=
$principalUri
;
$fields
=
array_values
(
$this
->
propertyMap
);
...
...
apps/dav/lib/carddav/carddavbackend.php
View file @
4c738ea9
...
...
@@ -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
();
...
...
apps/dav/lib/connector/sabre/principal.php
View file @
4c738ea9
...
...
@@ -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 */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment