Page MenuHomePhorge

D5406.1775244557.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D5406.1775244557.diff

diff --git a/plugins/libkolab/lib/kolab_subscriptions.php b/plugins/libkolab/lib/kolab_subscriptions.php
--- a/plugins/libkolab/lib/kolab_subscriptions.php
+++ b/plugins/libkolab/lib/kolab_subscriptions.php
@@ -33,6 +33,7 @@
private $folders_list;
private $folders_type;
private $icache = [];
+ private $protected_folders = [];
/**
* Object constructor
@@ -42,6 +43,7 @@
public function __construct($dav_url = null)
{
$this->rc = rcube::get_instance();
+ $this->protected_folders = $this->rc->config->get('activesync_force_subscription_state', []);
if ($dav_url) {
$this->dav = new kolab_storage_dav($dav_url);
@@ -123,9 +125,10 @@
$result = $this->get_subscriptions($deviceid, $type);
+ $forcedFolders = $this->protected_folders;
+ $folders = $this->list_folders($type);
// Verify if subscribed folders still exist
if (!empty($result)) {
- $folders = $this->list_folders($type);
foreach ($result as $idx => $flag) {
reset($folders);
@@ -140,6 +143,7 @@
$update = true;
unset($result[$idx]);
+ unset($forcedFolders[$idx]);
}
// Update subscriptions if any folder was removed from the list
@@ -149,6 +153,17 @@
}
}
+ foreach ($forcedFolders as $idx => $flag) {
+ foreach ($folders as $folder) {
+ if (preg_match("|$idx|", $folder[0])) {
+ $folderPath = $folder[0];
+ $folder[0] = $flag;
+ $result[$folderPath] = $folder;
+ continue 2;
+ }
+ }
+ }
+
return $result ?? [];
}

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 3, 7:29 PM (3 h, 57 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18826011
Default Alt Text
D5406.1775244557.diff (1 KB)

Event Timeline