summaryrefslogtreecommitdiff
path: root/lib/Kolab/CalDAV/CalendarBackend.php
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-01-07 10:48:26 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-01-07 15:40:26 (GMT)
commit13b1c30d140314ebc2379e26b35fa8e7bacd67e8 (patch)
treeab11403bac4e8f3c60ebf3db4b0e8f5e08c69e7f /lib/Kolab/CalDAV/CalendarBackend.php
parent490dada1594a8b29f7b586ac5f6f61998fc4be10 (diff)
downloadiRony-13b1c30d140314ebc2379e26b35fa8e7bacd67e8.tar.gz
Ignore IMAP subscriptions when accessing a folder directly via UID/Name (#2701)
Diffstat (limited to 'lib/Kolab/CalDAV/CalendarBackend.php')
-rw-r--r--lib/Kolab/CalDAV/CalendarBackend.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Kolab/CalDAV/CalendarBackend.php b/lib/Kolab/CalDAV/CalendarBackend.php
index 17eba73..213dbea 100644
--- a/lib/Kolab/CalDAV/CalendarBackend.php
+++ b/lib/Kolab/CalDAV/CalendarBackend.php
@@ -48,6 +48,7 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend
private $aliases;
private $useragent;
private $type_component_map = array('event' => 'VEVENT', 'task' => 'VTODO');
+ private $subscribed = null;
/**
* Read available calendar folders from server
@@ -59,7 +60,7 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend
return $this->calendars;
// get all folders that have "event" type
- $folders = array_merge(kolab_storage::get_folders('event'), kolab_storage::get_folders('task'));
+ $folders = array_merge(kolab_storage::get_folders('event', $this->subscribed), kolab_storage::get_folders('task', $this->subscribed));
$this->calendars = $this->folders = $this->aliases = array();
foreach (kolab_storage::sort_folders($folders) as $folder) {
@@ -164,6 +165,13 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend
$this->calendars[$id]['principaluri'] = 'principals/' . HTTPBasic::$current_user;
}
+ // retry with subscribed = false (#2701)
+ if (empty($this->calendars[$id]) && $this->subscribed === null && rcube::get_instance()->config->get('kolab_use_subscriptions')) {
+ $this->subscribed = false;
+ unset($this->calendars);
+ return $this->getCalendarByName($calendarUri);
+ }
+
return $this->calendars[$id];
}