summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-03-13 11:22:58 (GMT)
committerAleksander Machniak <alec@alec.pl>2015-03-13 11:22:58 (GMT)
commit96442eae9d8f87a4a3ab2aee6b717dc0191d0a97 (patch)
tree56cb4ad07be500e041e126f47062b198ea57049f
parent69d702c6b226b905c3f4d375e885b6a3272bc8a4 (diff)
downloadroundcubemail-plugins-kolab-96442eae9d8f87a4a3ab2aee6b717dc0191d0a97.tar.gz
Fix so prewarm and update actions do not skip objects of type note and journal
-rwxr-xr-xplugins/libkolab/bin/modcache.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/libkolab/bin/modcache.sh b/plugins/libkolab/bin/modcache.sh
index 01f1822..96bff2f 100755
--- a/plugins/libkolab/bin/modcache.sh
+++ b/plugins/libkolab/bin/modcache.sh
@@ -67,6 +67,9 @@ if (!$db->is_connected() || $db->is_error())
ini_set('display_errors', 1);
+// All supported object types
+$all_types = array('contact','configuration','event','file','journal','note','task');
+
/*
* Script controller
*/
@@ -76,7 +79,7 @@ switch (strtolower($action)) {
* Clear/expunge all cache records
*/
case 'expunge':
- $folder_types = $opts['type'] ? explode(',', $opts['type']) : array('contact','configuration','event','file','journal','note','task');
+ $folder_types = $opts['type'] ? explode(',', $opts['type']) : $all_types;
$folder_types_db = array_map(array($db, 'quote'), $folder_types);
$expire = strtotime(!empty($opts[2]) ? $opts[2] : 'now - 10 days');
$sql_where = "type IN (" . join(',', $folder_types_db) . ")";
@@ -99,7 +102,7 @@ case 'expunge':
break;
case 'clear':
- $folder_types = $opts['type'] ? explode(',', $opts['type']) : array('contact','configuration','event','file','journal','note','task');
+ $folder_types = $opts['type'] ? explode(',', $opts['type']) : $all_types;
$folder_types_db = array_map(array($db, 'quote'), $folder_types);
if ($opts['all']) {
@@ -124,7 +127,7 @@ case 'prewarm':
$rcmail->plugins->load_plugin('libkolab');
if (authenticate($opts)) {
- $folder_types = $opts['type'] ? explode(',', $opts['type']) : array('contact','configuration','event','file','task');
+ $folder_types = $opts['type'] ? explode(',', $opts['type']) : $all_types;
foreach ($folder_types as $type) {
// sync every folder of the given type
foreach (kolab_storage::get_folders($type) as $folder) {
@@ -151,7 +154,7 @@ case 'update':
// make sure libkolab classes are loaded
$rcmail->plugins->load_plugin('libkolab');
- $folder_types = $opts['type'] ? explode(',', $opts['type']) : array('contact','configuration','event','file','task');
+ $folder_types = $opts['type'] ? explode(',', $opts['type']) : $all_types;
foreach ($folder_types as $type) {
$class = 'kolab_storage_cache_' . $type;
$sql_result = $db->query("SELECT folder_id FROM kolab_folders WHERE type=? AND synclock = 0", $type);