diff --git a/ansel/docs/CHANGES b/ansel/docs/CHANGES index 92e13140e21..97c13d9878b 100644 --- a/ansel/docs/CHANGES +++ b/ansel/docs/CHANGES @@ -2,6 +2,7 @@ v3.0.2-git ---------- +[jan] Return ETags with browse() API method. [mjr] Fix fatal divide by zero error due to incorrectly named variable. [jan] Fix type of ansel_shares_users.user_uid column. [jan] Fix watermark font size preference. diff --git a/ansel/lib/Api.php b/ansel/lib/Api.php index 0e0bab5ec44..f4aec10c388 100644 --- a/ansel/lib/Api.php +++ b/ansel/lib/Api.php @@ -153,7 +153,7 @@ public function browse($path = '', array $properties = array()) $results[$retpath]['contenttype'] = $image['type']; } if (in_array('contentlength', $properties)) { - $results[$retpath]['contentlength'] = 0; + $results[$retpath]['contentlength'] = 1; } if (in_array('modified', $properties)) { $results[$retpath]['modified'] = $image['uploaded']; @@ -161,6 +161,9 @@ public function browse($path = '', array $properties = array()) if (in_array('created', $properties)) { $results[$retpath]['created'] = $image['uploaded']; } + if (in_array('etag', $properties)) { + $results[$retpath]['etag'] = '"' . md5($imageId . '|' . $image['uploaded']) . '"'; + } } return $results; diff --git a/ansel/package.xml b/ansel/package.xml index 485c73789ba..3089af0a206 100644 --- a/ansel/package.xml +++ b/ansel/package.xml @@ -33,6 +33,7 @@ GPL-2.0 +* [jan] Return ETags with browse() API method. * [mjr] Fix fatal divide by zero error due to incorrectly named variable. * [jan] Fix type of ansel_shares_users.user_uid column. * [jan] Fix watermark font size preference. @@ -1349,6 +1350,7 @@ 2014-02-24 GPL-2.0 +* [jan] Return ETags with browse() API method. * [mjr] Fix fatal divide by zero error due to incorrectly named variable. * [jan] Fix type of ansel_shares_users.user_uid column. * [jan] Fix watermark font size preference. diff --git a/kronolith/docs/CHANGES b/kronolith/docs/CHANGES index 11cbae133b1..ca9c2e4d719 100644 --- a/kronolith/docs/CHANGES +++ b/kronolith/docs/CHANGES @@ -2,6 +2,7 @@ v4.3.0-git ---------- +[jan] Return ETags with browse() API method. [jan] Add importing of calendar data from a URL. diff --git a/kronolith/lib/Api.php b/kronolith/lib/Api.php index 9740cea8708..736764f470b 100644 --- a/kronolith/lib/Api.php +++ b/kronolith/lib/Api.php @@ -184,6 +184,10 @@ public function browse($path = '', $properties = array()) foreach ($events as $dayevents) { foreach ($dayevents as $event) { $key = 'kronolith/' . $path . '/' . $event->id; + if (in_array('modified', $properties) || + in_array('etag', $properties)) { + $modified = $this->modified($event->uid); + } if (in_array('name', $properties)) { $results[$key]['name'] = $event->getTitle(); } @@ -207,11 +211,14 @@ public function browse($path = '', $properties = array()) $results[$key]['contentlength'] = 1; } if (in_array('modified', $properties)) { - $results[$key]['modified'] = $this->modified($event->uid); + $results[$key]['modified'] = $modified; } if (in_array('created', $properties)) { $results[$key]['created'] = $this->getActionTimestamp($event->uid, 'add'); } + if (in_array('etag', $properties)) { + $results[$key]['etag'] = '"' . md5($event->id . '|' . $modified) . '"'; + } } } return $results; diff --git a/kronolith/package.xml b/kronolith/package.xml index ca020026c6b..b4785134c28 100644 --- a/kronolith/package.xml +++ b/kronolith/package.xml @@ -33,6 +33,7 @@ GPL-2.0 +* [jan] Return ETags with browse() API method. * [jan] Add importing of calendar data from a URL. @@ -2441,6 +2442,7 @@ 2014-06-04 GPL-2.0 +* [jan] Return ETags with browse() API method. * [jan] Add importing of calendar data from a URL. diff --git a/mnemo/docs/CHANGES b/mnemo/docs/CHANGES index 887ec020010..8a2997a1b1e 100644 --- a/mnemo/docs/CHANGES +++ b/mnemo/docs/CHANGES @@ -2,6 +2,7 @@ v4.3.0-git ---------- +[jan] Return ETags with browse() API method. [jan] Add browse(), put(), and path_delete() methods to API to support WebDAV access. diff --git a/mnemo/lib/Api.php b/mnemo/lib/Api.php index aba4faadd28..636ed65bcbb 100644 --- a/mnemo/lib/Api.php +++ b/mnemo/lib/Api.php @@ -189,6 +189,9 @@ public function browse($path = '', $properties = array()) if (in_array('created', $properties)) { $results[$key]['created'] = isset($memo['created']) ? $memo['created'] : 0; } + if (in_array('etag', $properties)) { + $results[$key]['etag'] = '"' . md5($memo['memo_id'] . '|' . $this->_modified($memo)) . '"'; + } } return $results; } else { diff --git a/mnemo/package.xml b/mnemo/package.xml index c1901dee7ec..a64fff98e2e 100644 --- a/mnemo/package.xml +++ b/mnemo/package.xml @@ -27,6 +27,7 @@ ASL +* [jan] Return ETags with browse() API method. * [jan] Add browse(), put(), and path_delete() methods to API to support WebDAV access. @@ -1246,6 +1247,7 @@ 2014-05-06 ASL +* [jan] Return ETags with browse() API method. * [jan] Add browse(), put(), and path_delete() methods to API to support WebDAV access. diff --git a/nag/docs/CHANGES b/nag/docs/CHANGES index b896b3335b8..5fac277c804 100644 --- a/nag/docs/CHANGES +++ b/nag/docs/CHANGES @@ -2,6 +2,7 @@ v4.3.0-git ---------- +[jan] Return ETags with browse() API method. ---------- v4.2.1 diff --git a/nag/lib/Api.php b/nag/lib/Api.php index ccdc83c292c..3794cc2afe6 100644 --- a/nag/lib/Api.php +++ b/nag/lib/Api.php @@ -376,6 +376,10 @@ public function browse($path = '', $properties = array()) $storage->tasks->reset(); while ($task = $storage->tasks->each()) { $key = 'nag/' . $parts[0] . '/' . $parts[1] . '/' . $task->id; + if (in_array('modified', $properties) || + in_array('etag', $properties)) { + $modified = $this->modified($task->uid, $parts[1]); + } if (in_array('name', $properties)) { $results[$key]['name'] = $task->name; } @@ -398,11 +402,14 @@ public function browse($path = '', $properties = array()) $results[$key]['contentlength'] = 1; } if (in_array('modified', $properties)) { - $results[$key]['modified'] = $this->modified($task->uid, $parts[1]); + $results[$key]['modified'] = $modified; } if (in_array('created', $properties)) { $results[$key]['created'] = $this->getActionTimestamp($task->uid, 'add', $parts[1]); } + if (in_array('etag', $properties)) { + $results[$key]['etag'] = '"' . md5($task->id . '|' . $modified) . '"'; + } } return $results; } else { diff --git a/nag/package.xml b/nag/package.xml index 92063bf325b..988b1fe2954 100644 --- a/nag/package.xml +++ b/nag/package.xml @@ -33,7 +33,7 @@ GPL-2.0 -* +* [jan] Return ETags with browse() API method. @@ -1587,7 +1587,7 @@ 2014-06-04 GPL-2.0 -* +* [jan] Return ETags with browse() API method. diff --git a/turba/docs/CHANGES b/turba/docs/CHANGES index fb1f85881e7..7ccb54e762c 100644 --- a/turba/docs/CHANGES +++ b/turba/docs/CHANGES @@ -2,6 +2,7 @@ v4.3.0-git ---------- +[jan] Return ETags with browse() API method. [jan] Support multi-value RDNs in LDAP DN attributes (horde@iotti.biz, Request #11889). diff --git a/turba/lib/Api.php b/turba/lib/Api.php index 5cb452651c1..003445d90c9 100644 --- a/turba/lib/Api.php +++ b/turba/lib/Api.php @@ -188,7 +188,7 @@ public function getGalUid() * @throws Horde_Exception_NotFound */ public function browse($path = '', - $properties = array('name', 'icon', 'browseable')) + $properties = array('name', 'icon', 'browseable')) { global $injector, $registry, $session; @@ -360,11 +360,14 @@ public function browse($path = '', $results[$key]['contentlength'] = strlen($data); } if (in_array('modified', $properties)) { - $results[$key]['modified'] = $this->_modified($contact->getValue('__uid'), $parts[1]); + $results[$key]['modified'] = $contact->lastModification(); } if (in_array('created', $properties)) { $results[$key]['created'] = $this->getActionTimestamp($contact->getValue('__uid'), 'add', $parts[1]); } + if (in_array('etag', $properties)) { + $results[$key]['etag'] = '"' . md5($contact->getValue('__key') . '|' . $contact->lastModification()) . '"'; + } } return $results; diff --git a/turba/package.xml b/turba/package.xml index 2b4c214bc64..00aff86ccda 100644 --- a/turba/package.xml +++ b/turba/package.xml @@ -39,6 +39,7 @@ ASL +* [jan] Return ETags with browse() API method. * [jan] Support multi-value RDNs in LDAP DN attributes (horde@iotti.biz, Request #11889).