From da03d057007d885914dfac7c92cca51747b5f44b Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 2 May 2012 16:41:00 +0200 Subject: create folder 'remote' for the remote services like caldav, carddav and webdav --- apps/calendar/appinfo/install.php | 4 ++++ apps/calendar/appinfo/remote.php | 35 +++++++++++++++++++++++++++++++++++ apps/calendar/appinfo/update.php | 3 +++ apps/calendar/caldav.php | 36 ------------------------------------ 4 files changed, 42 insertions(+), 36 deletions(-) create mode 100644 apps/calendar/appinfo/install.php create mode 100644 apps/calendar/appinfo/remote.php delete mode 100644 apps/calendar/caldav.php (limited to 'apps/calendar') diff --git a/apps/calendar/appinfo/install.php b/apps/calendar/appinfo/install.php new file mode 100644 index 00000000000..c5a9a72f26f --- /dev/null +++ b/apps/calendar/appinfo/install.php @@ -0,0 +1,4 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ +// Do not load FS ... +$RUNTIME_NOSETUPFS = true; +require_once('../lib/base.php'); + +OC_Util::checkAppEnabled('calendar'); + +// Backends +$authBackend = new OC_Connector_Sabre_Auth(); +$principalBackend = new OC_Connector_Sabre_Principal(); +$caldavBackend = new OC_Connector_Sabre_CalDAV(); + +// Root nodes +$nodes = array( + new Sabre_CalDAV_Principal_Collection($principalBackend), + new Sabre_CalDAV_CalendarRootNode($principalBackend, $caldavBackend), +); + +// Fire up server +$server = new Sabre_DAV_Server($nodes); +$server->setBaseUri(OC::$WEBROOT.'/remote/caldav.php'); +// Add plugins +$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud')); +$server->addPlugin(new Sabre_CalDAV_Plugin()); +$server->addPlugin(new Sabre_DAVACL_Plugin()); +$server->addPlugin(new Sabre_DAV_Browser_Plugin(false)); // Show something in the Browser, but no upload + +// And off we go! +$server->exec(); diff --git a/apps/calendar/appinfo/update.php b/apps/calendar/appinfo/update.php index 9f52f91392d..78e4f2d8748 100755 --- a/apps/calendar/appinfo/update.php +++ b/apps/calendar/appinfo/update.php @@ -15,3 +15,6 @@ if (version_compare($installedVersion, '0.2.1', '<')) { $r = $stmt->execute(array($color,$id)); } } +if(!file_exists(OC::$WEBROOT.'/remote/caldav.php')){ + file_put_contents(OC::$WEBROOT.'/remote/caldav.php', file_get_contents(OC::$APPROOT . '/apps/calendar/appinfo/remote.php')); +} \ No newline at end of file diff --git a/apps/calendar/caldav.php b/apps/calendar/caldav.php deleted file mode 100644 index 7210b25879f..00000000000 --- a/apps/calendar/caldav.php +++ /dev/null @@ -1,36 +0,0 @@ - - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -// Do not load FS ... -$RUNTIME_NOSETUPFS = true; -require_once('../inc.php'); - -OC_Util::checkAppEnabled('calendar'); - -// Backends -$authBackend = new OC_Connector_Sabre_Auth(); -$principalBackend = new OC_Connector_Sabre_Principal(); -$caldavBackend = new OC_Connector_Sabre_CalDAV(); - -// Root nodes -$nodes = array( - new Sabre_CalDAV_Principal_Collection($principalBackend), - new Sabre_CalDAV_CalendarRootNode($principalBackend, $caldavBackend), -); - -// Fire up server -$server = new Sabre_DAV_Server($nodes); -$server->setBaseUri(OC::$APPSWEBROOT.'/apps/calendar/caldav.php'); -// Add plugins -$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud')); -$server->addPlugin(new Sabre_CalDAV_Plugin()); -$server->addPlugin(new Sabre_DAVACL_Plugin()); -$server->addPlugin(new Sabre_DAV_Browser_Plugin(false)); // Show something in the Browser, but no upload - -// And off we go! -$server->exec(); -- cgit v1.2.3