summaryrefslogtreecommitdiff
path: root/lib/Kolab/CardDAV/ContactsBackend.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/CardDAV/ContactsBackend.php
parent490dada1594a8b29f7b586ac5f6f61998fc4be10 (diff)
downloadiRony-13b1c30d140314ebc2379e26b35fa8e7bacd67e8.tar.gz
Ignore IMAP subscriptions when accessing a folder directly via UID/Name (#2701)
Diffstat (limited to 'lib/Kolab/CardDAV/ContactsBackend.php')
-rw-r--r--lib/Kolab/CardDAV/ContactsBackend.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Kolab/CardDAV/ContactsBackend.php b/lib/Kolab/CardDAV/ContactsBackend.php
index 0a342da..45ba54b 100644
--- a/lib/Kolab/CardDAV/ContactsBackend.php
+++ b/lib/Kolab/CardDAV/ContactsBackend.php
@@ -43,6 +43,7 @@ class ContactsBackend extends CardDAV\Backend\AbstractBackend
private $folders;
private $aliases;
private $useragent;
+ private $subscribed = null;
/**
@@ -55,7 +56,7 @@ class ContactsBackend extends CardDAV\Backend\AbstractBackend
return $this->sources;
// get all folders that have "contact" type
- $folders = kolab_storage::get_folders('contact');
+ $folders = kolab_storage::get_folders('contact', $this->subscribed);
$this->sources = $this->folders = $this->aliases = array();
foreach (kolab_storage::sort_folders($folders) as $folder) {
@@ -164,6 +165,13 @@ class ContactsBackend extends CardDAV\Backend\AbstractBackend
$id = $this->aliases[$addressBookUri];
}
+ // retry with subscribed = false (#2701)
+ if (empty($this->sources[$id]) && $this->subscribed === null && rcube::get_instance()->config->get('kolab_use_subscriptions')) {
+ $this->subscribed = false;
+ unset($this->sources);
+ return $this->getAddressBookByName($addressBookUri);
+ }
+
return $this->sources[$id];
}