summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-11-04 15:40:59 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2016-11-04 15:40:59 +0100
commit1e6175dfcbb7a0c554fecf62c2d31a422df841e6 (patch)
treeaa2e7fc6a465742b2bf6aa8ce0e6596b57052640 /apps/dav/lib/CalDAV
parentc016d947e2243329243b62a41caab82a4ff46a10 (diff)
downloadnextcloud-server-1e6175dfcbb7a0c554fecf62c2d31a422df841e6.tar.gz
nextcloud-server-1e6175dfcbb7a0c554fecf62c2d31a422df841e6.zip
Fix CalendarTest
* Made sure delete from self works again (and is tested) Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib/CalDAV')
-rw-r--r--apps/dav/lib/CalDAV/Calendar.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/dav/lib/CalDAV/Calendar.php b/apps/dav/lib/CalDAV/Calendar.php
index 2df8944b83f..9fedbe6f91f 100644
--- a/apps/dav/lib/CalDAV/Calendar.php
+++ b/apps/dav/lib/CalDAV/Calendar.php
@@ -153,7 +153,8 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
}
function delete() {
- if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) {
+ if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal']) &&
+ $this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri']) {
$principal = 'principal:' . parent::getOwner();
$shares = $this->getShares();
$shares = array_filter($shares, function($share) use ($principal){
@@ -283,6 +284,10 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable {
}
private function isShared() {
+ if (!isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) {
+ return false;
+ }
+
return $this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri'];
}