Skip to content

Commit

Permalink
Remove old cruft no longer necessary since switching to SabreDAV.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Oct 28, 2014
1 parent 9ded30f commit 2f58173
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 196 deletions.
28 changes: 0 additions & 28 deletions ansel/lib/Api.php
Expand Up @@ -55,19 +55,6 @@ public function browse($path = '', array $properties = array())
if (in_array('browseable', $properties)) {
$results['ansel/' . $owner]['browseable'] = true;
}
if (in_array('contenttype', $properties)) {
$results['ansel/' . $owner]['contenttype'] =
'httpd/unix-directory';
}
if (in_array('contentlength', $properties)) {
$results['ansel/' . $owner]['contentlength'] = 0;
}
if (in_array('modified', $properties)) {
$results['ansel/' . $owner]['modified'] = time();
}
if (in_array('created', $properties)) {
$results['ansel/' . $owner]['created'] = 0;
}
}
return $results;
} else {
Expand Down Expand Up @@ -121,18 +108,6 @@ public function browse($path = '', array $properties = array())
$results[$retpath]['browseable'] = $gallery->hasPermission(
$GLOBALS['registry']->getAuth(), Horde_Perms::READ);
}
if (in_array('contenttype', $properties)) {
$results[$retpath]['contenttype'] = 'httpd/unix-directory';
}
if (in_array('contentlength', $properties)) {
$results[$retpath]['contentlength'] = 0;
}
if (in_array('modified', $properties)) {
$results[$retpath]['modified'] = time();
}
if (in_array('created', $properties)) {
$results[$retpath]['created'] = 0;
}
}

foreach ($images as $imageId => $image) {
Expand All @@ -152,9 +127,6 @@ public function browse($path = '', array $properties = array())
if (in_array('contenttype', $properties)) {
$results[$retpath]['contenttype'] = $image['type'];
}
if (in_array('contentlength', $properties)) {
$results[$retpath]['contentlength'] = 1;
}
if (in_array('modified', $properties)) {
$results[$retpath]['modified'] = $image['uploaded'];
}
Expand Down
63 changes: 8 additions & 55 deletions kronolith/lib/Api.php
Expand Up @@ -89,32 +89,8 @@ public function browse($path = '', $properties = array())
if (in_array('browseable', $properties)) {
$results[$path]['browseable'] = true;
}
if (in_array('contenttype', $properties)) {
$results[$path]['contenttype'] =
'httpd/unix-directory';
}
if (in_array('contentlength', $properties)) {
$results[$path]['contentlength'] = 0;
}
if (in_array('modified', $properties)) {
$results[$path]['modified'] =
$_SERVER['REQUEST_TIME'];
}
if (in_array('created', $properties)) {
$results[$path]['created'] = 0;
}

// CalDAV Properties from RFC 4791 and
// draft-desruisseaux-caldav-sched-03
$caldavns = 'urn:ietf:params:xml:ns:caldav';
$kronolith_rpc_base = $GLOBALS['registry']->get('webroot', 'horde') . '/rpc/kronolith/';
if (in_array($caldavns . ':calendar-home-set', $properties)) {
$results[$path][$caldavns . ':calendar-home-set'] = Horde::url($kronolith_rpc_base . urlencode($owner), true);
}

if (in_array($caldavns . ':calendar-user-address-set', $properties)) {
// FIXME: Add the calendar owner's email address from
// their Horde Identity
if (in_array('read-only', $properties)) {
$results[$path]['read-only'] = true;
}
}
return $results;
Expand Down Expand Up @@ -149,27 +125,8 @@ public function browse($path = '', $properties = array())
$results[$retpath . '.ics']['browseable'] = false;
}
if (in_array('contenttype', $properties)) {
$results[$retpath]['contenttype'] = 'httpd/unix-directory';
$results[$retpath . '.ics']['contenttype'] = 'text/calendar';
}
if (in_array('contentlength', $properties)) {
$results[$retpath]['contentlength'] = 0;
// FIXME: This is a hack. If the content length is longer
// than the actual data then some WebDAV clients will
// report an error when the file EOF is received. Ideally
// we should determine the actual size of the .ics and
// report it here, but the performance hit may be
// prohibitive. This requires further investigation.
$results[$retpath . '.ics']['contentlength'] = 1;
}
if (in_array('modified', $properties)) {
$results[$retpath]['modified'] = $_SERVER['REQUEST_TIME'];
$results[$retpath . '.ics']['modified'] = $_SERVER['REQUEST_TIME'];
}
if (in_array('created', $properties)) {
$results[$retpath]['created'] = 0;
$results[$retpath . '.ics']['created'] = 0;
}
}
return $results;

Expand All @@ -192,25 +149,21 @@ public function browse($path = '', $properties = array())
if (in_array('name', $properties)) {
$results[$key]['name'] = $event->getTitle();
}
if (in_array('owner', $properties)) {
$results[$key]['owner'] = $calendar->get('owner') ?: '-system-';
}
if (in_array('icon', $properties)) {
$results[$key]['icon'] = $icon;
}
if (in_array('browseable', $properties)) {
$results[$key]['browseable'] = false;
}
if (in_array('read-only', $properties)) {
$results[$key]['read-only'] = !$calendar->hasPermission($currentUser, Horde_Perms::EDIT);
}
if (in_array('contenttype', $properties)) {
$results[$key]['contenttype'] = 'text/calendar';
}
if (in_array('contentlength', $properties)) {
// FIXME: This is a hack. If the content length is
// longer than the actual data then some WebDAV
// clients will report an error when the file EOF is
// received. Ideally we should determine the actual
// size of the data and report it here, but the
// performance hit may be prohibitive. This requires
// further investigation.
$results[$key]['contentlength'] = 1;
}
if (in_array('modified', $properties)) {
$results[$key]['modified'] = $modified;
}
Expand Down
32 changes: 0 additions & 32 deletions mnemo/lib/Api.php
Expand Up @@ -90,19 +90,6 @@ public function browse($path = '', $properties = array())
if (in_array('browseable', $properties)) {
$results['mnemo/' . $owner]['browseable'] = true;
}
if (in_array('contenttype', $properties)) {
$results['mnemo/' . $owner]['contenttype'] =
'httpd/unix-directory';
}
if (in_array('contentlength', $properties)) {
$results['mnemo/' . $owner]['contentlength'] = 0;
}
if (in_array('modified', $properties)) {
$results['mnemo/' . $owner]['modified'] =
$_SERVER['REQUEST_TIME'];
}
if (in_array('created', $properties)) {
$results['mnemo/' . $owner]['created'] = 0;
}
}
return $results;
Expand Down Expand Up @@ -130,19 +117,6 @@ public function browse($path = '', $properties = array())
if (in_array('browseable', $properties)) {
$results[$retpath]['browseable'] = $notepad->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ);
}
if (in_array('contenttype', $properties)) {
$results[$retpath]['contenttype'] = 'httpd/unix-directory';
}
if (in_array('contentlength', $properties)) {
$results[$retpath]['contentlength'] = 0;
}
if (in_array('modified', $properties)) {
// @TODO Find a way to get the actual modification times
$results[$retpath]['modified'] = $_SERVER['REQUEST_TIME'];
}
if (in_array('created', $properties)) {
// @TODO Find a way to get the actual creation times
$results[$retpath]['created'] = 0;
}
}
return $results;
Expand Down Expand Up @@ -221,12 +195,6 @@ public function browse($path = '', $properties = array())
$result['mtime'] = $modified;
}
return $result;
} elseif (count($parts) == 2 &&
substr($parts[1], -4) == '.txt' &&
Mnemo::hasPermission(substr($parts[1], 0, -4), Horde_Perms::READ)) {

// ??

} else {
//
// All other requests are a 404: Not Found
Expand Down
44 changes: 0 additions & 44 deletions nag/lib/Api.php
Expand Up @@ -277,20 +277,6 @@ public function browse($path = '', $properties = array())
if (in_array('browseable', $properties)) {
$results['nag/' . $owner]['browseable'] = true;
}
if (in_array('contenttype', $properties)) {
$results['nag/' . $owner]['contenttype'] =
'httpd/unix-directory';
}
if (in_array('contentlength', $properties)) {
$results['nag/' . $owner]['contentlength'] = 0;
}
if (in_array('modified', $properties)) {
$results['nag/' . $owner]['modified'] =
$_SERVER['REQUEST_TIME'];
}
if (in_array('created', $properties)) {
$results['nag/' . $owner]['created'] = 0;
}
}
return $results;

Expand Down Expand Up @@ -321,23 +307,8 @@ public function browse($path = '', $properties = array())
$results[$retpath . '.ics']['browseable'] = false;
}
if (in_array('contenttype', $properties)) {
$results[$retpath]['contenttype'] = 'httpd/unix-directory';
$results[$retpath . '.ics']['contenttype'] = 'text/calendar';
}
if (in_array('contentlength', $properties)) {
$results[$retpath]['contentlength'] = 0;
$results[$retpath . '.ics']['contentlength'] = strlen($this->exportTasklist($tasklistId, 'text/calendar'));
}
if (in_array('modified', $properties)) {
// @TODO Find a way to get the actual modification times
$results[$retpath]['modified'] = $_SERVER['REQUEST_TIME'];
$results[$retpath . '.ics']['modified'] = $_SERVER['REQUEST_TIME'];
}
if (in_array('created', $properties)) {
// @TODO Find a way to get the actual creation times
$results[$retpath]['created'] = 0;
$results[$retpath . '.ics']['created'] = 0;
}
}
return $results;

Expand Down Expand Up @@ -392,15 +363,6 @@ public function browse($path = '', $properties = array())
if (in_array('contenttype', $properties)) {
$results[$key]['contenttype'] = 'text/calendar';
}
if (in_array('contentlength', $properties)) {
// FIXME: This is a hack. If the content length is longer
// than the actual data then some WebDAV clients will report
// an error when the file EOF is received. Ideally we should
// determine the actual size of the data and report it here, but
// the performance hit may be prohibitive. This requires
// further investigation.
$results[$key]['contentlength'] = 1;
}
if (in_array('modified', $properties)) {
$results[$key]['modified'] = $modified;
}
Expand Down Expand Up @@ -437,12 +399,6 @@ public function browse($path = '', $properties = array())
$result['mtime'] = $modified;
}
return $result;
} elseif (count($parts) == 2 &&
substr($parts[1], -4) == '.ics' &&
Nag::hasPermission(substr($parts[1], 0, -4), Horde_Perms::READ)) {

// ??

} else {
//
// All other requests are a 404: Not Found
Expand Down
37 changes: 0 additions & 37 deletions turba/lib/Api.php
Expand Up @@ -224,20 +224,6 @@ public function browse($path = '',
if (in_array('browseable', $properties)) {
$results['turba/' . $owner]['browseable'] = true;
}
if (in_array('contenttype', $properties)) {
$results['turba/' . $owner]['contenttype'] = 'httpd/unix-directory';
}
if (in_array('contentlength', $properties)) {
$results['turba/' . $owner]['contentlength'] = 0;
}
if (in_array('modified', $properties)) {
// @TODO: Get a real modification date
$results['turba/' . $owner]['modified'] = $now;
}
if (in_array('created', $properties)) {
// @TODO Get a real creation date
$results['turba/' . $owner]['created'] = 0;
}
}

return $results;
Expand Down Expand Up @@ -280,7 +266,6 @@ public function browse($path = '',
}

$curpath = 'turba/' . $parts[0] . '/';
$now = time();

foreach ($addressbooks as $addressbook => $info) {
if (in_array('name', $properties)) {
Expand All @@ -298,20 +283,6 @@ public function browse($path = '',
if (in_array('browseable', $properties)) {
$results[$curpath . $addressbook]['browseable'] = true;
}
if (in_array('contenttype', $properties)) {
$results[$curpath . $addressbook]['contenttype'] = 'httpd/unix-directory';
}
if (in_array('contentlength', $properties)) {
$results[$curpath . $addressbook]['contentlength'] = 0;
}
if (in_array('modified', $properties)) {
// @TODO: Get a real modification date
$results[$curpath . $addressbook]['modified'] = $now;
}
if (in_array('created', $properties)) {
// @TODO Get a real creation date
$results[$curpath . $addressbook]['created'] = 0;
}
}

return $results;
Expand Down Expand Up @@ -351,14 +322,6 @@ public function browse($path = '',
if (in_array('contenttype', $properties)) {
$results[$key]['contenttype'] = 'text/x-vcard';
}
if (in_array('contentlength', $properties)) {
try {
$data = $this->export($contact->getValue('__uid'), 'text/x-vcard', $contact->getSource(), null, array('skip_empty' => true));
} catch (Turba_Exception $e) {
$data = '';
}
$results[$key]['contentlength'] = strlen($data);
}
if (in_array('modified', $properties)) {
$results[$key]['modified'] = $contact->lastModification();
}
Expand Down

0 comments on commit 2f58173

Please sign in to comment.