]> source.dussan.org Git - nextcloud-server.git/commitdiff
create folder 'remote' for the remote services like caldav, carddav and webdav
authorGeorg Ehrke <dev@georgswebsite.de>
Wed, 2 May 2012 14:41:00 +0000 (16:41 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Wed, 2 May 2012 14:41:23 +0000 (16:41 +0200)
16 files changed:
.htaccess
apps/calendar/appinfo/install.php [new file with mode: 0644]
apps/calendar/appinfo/remote.php [new file with mode: 0644]
apps/calendar/appinfo/update.php
apps/calendar/caldav.php [deleted file]
apps/contacts/appinfo/install.php [new file with mode: 0644]
apps/contacts/appinfo/remote.php [new file with mode: 0644]
apps/contacts/appinfo/update.php [new file with mode: 0644]
apps/contacts/carddav.php [deleted file]
apps/files/appinfo/install.php [new file with mode: 0644]
apps/files/appinfo/remote.php [new file with mode: 0644]
apps/files/appinfo/update.php [new file with mode: 0644]
apps/files/webdav.php [deleted file]
apps/inc.php [deleted file]
index.php
lib/base.php

index 96ecb685d5235acaa1c31dfcfae5a88ce9793d5b..100975ef4cbb585d9315c8b333024a41646ee738 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -1,5 +1,9 @@
 ErrorDocument 403 /core/templates/403.php
 ErrorDocument 404 /core/templates/404.php
+Redirect 301 /apps/calendar/caldav.php /remote/caldav.php
+Redirect 301 /apps/contacts/carddav.php /remote/carddav.php
+Redirect 301 /apps/files/webdav.php /remote/webdav.php
+Redirect 301 /files/webdav.php /remote/webdav.php
 <IfModule mod_php5.c>
 php_value upload_max_filesize 512M
 php_value post_max_size 512M
@@ -11,7 +15,7 @@ php_value memory_limit 512M
 <IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
-RewriteRule ^.well-known/carddav /apps/contacts/carddav.php [R]
-RewriteRule ^.well-known/caldav /apps/calendar/caldav.php [R]
+RewriteRule ^.well-known/carddav /remote/carddav.php [R]
+RewriteRule ^.well-known/caldav /remote/caldav.php [R]
 </IfModule>
-Options -Indexes
+Options -Indexes
\ No newline at end of file
diff --git a/apps/calendar/appinfo/install.php b/apps/calendar/appinfo/install.php
new file mode 100644 (file)
index 0000000..c5a9a72
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+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/appinfo/remote.php b/apps/calendar/appinfo/remote.php
new file mode 100644 (file)
index 0000000..2fbb973
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Copyright (c) 2011 Jakob Sack <mail@jakobsack.de>
+ * 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();
index 9f52f91392dc1e6a3616bed5f49d7463d377e650..78e4f2d8748c8d2e7407863b8bcc0987ce8ddf23 100755 (executable)
@@ -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 (file)
index 7210b25..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * Copyright (c) 2011 Jakob Sack <mail@jakobsack.de>
- * 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();
diff --git a/apps/contacts/appinfo/install.php b/apps/contacts/appinfo/install.php
new file mode 100644 (file)
index 0000000..b87241b
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+if(!file_exists(OC::$WEBROOT.'/remote/carddav.php')){
+       file_put_contents(OC::$WEBROOT.'/remote/carddav.php', file_get_contents(OC::$APPROOT . '/apps/contacts/appinfo/remote.php'));
+}
\ No newline at end of file
diff --git a/apps/contacts/appinfo/remote.php b/apps/contacts/appinfo/remote.php
new file mode 100644 (file)
index 0000000..3ffdb64
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/**
+ * ownCloud - Addressbook
+ *
+ * @author Jakob Sack
+ * @copyright 2011 Jakob Sack mail@jakobsack.de
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+// Do not load FS ...
+$RUNTIME_NOSETUPFS = true;
+require_once('../lib/base.php');
+
+OC_Util::checkAppEnabled('contacts');
+
+// Backends
+$authBackend = new OC_Connector_Sabre_Auth();
+$principalBackend = new OC_Connector_Sabre_Principal();
+$carddavBackend   = new OC_Connector_Sabre_CardDAV();
+
+// Root nodes
+$nodes = array(
+       new Sabre_CalDAV_Principal_Collection($principalBackend),
+       new Sabre_CardDAV_AddressBookRoot($principalBackend, $carddavBackend),
+);
+
+// Fire up server
+$server = new Sabre_DAV_Server($nodes);
+$server->setBaseUri(OC::$WEBROOT.'/remote/carddav.php');
+// Add plugins
+$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
+$server->addPlugin(new Sabre_CardDAV_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/contacts/appinfo/update.php b/apps/contacts/appinfo/update.php
new file mode 100644 (file)
index 0000000..b87241b
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+if(!file_exists(OC::$WEBROOT.'/remote/carddav.php')){
+       file_put_contents(OC::$WEBROOT.'/remote/carddav.php', file_get_contents(OC::$APPROOT . '/apps/contacts/appinfo/remote.php'));
+}
\ No newline at end of file
diff --git a/apps/contacts/carddav.php b/apps/contacts/carddav.php
deleted file mode 100644 (file)
index 1a11ccd..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-/**
- * ownCloud - Addressbook
- *
- * @author Jakob Sack
- * @copyright 2011 Jakob Sack mail@jakobsack.de
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-// Do not load FS ...
-$RUNTIME_NOSETUPFS = true;
-require_once('../inc.php');
-
-OC_Util::checkAppEnabled('contacts');
-
-// Backends
-$authBackend = new OC_Connector_Sabre_Auth();
-$principalBackend = new OC_Connector_Sabre_Principal();
-$carddavBackend   = new OC_Connector_Sabre_CardDAV();
-
-// Root nodes
-$nodes = array(
-       new Sabre_CalDAV_Principal_Collection($principalBackend),
-       new Sabre_CardDAV_AddressBookRoot($principalBackend, $carddavBackend),
-);
-
-// Fire up server
-$server = new Sabre_DAV_Server($nodes);
-$server->setBaseUri(OC::$APPSWEBROOT.'/apps/contacts/carddav.php');
-// Add plugins
-$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
-$server->addPlugin(new Sabre_CardDAV_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/files/appinfo/install.php b/apps/files/appinfo/install.php
new file mode 100644 (file)
index 0000000..d00a1a3
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+if(!file_exists(OC::$WEBROOT.'/remote/webdav.php')){
+       file_put_contents(OC::$WEBROOT.'/remote/webdav.php', file_get_contents(OC::$APPROOT . '/apps/files/appinfo/webdav.php'));
+}
\ No newline at end of file
diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php
new file mode 100644 (file)
index 0000000..232a61e
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * ownCloud
+ *
+ * @author Frank Karlitschek
+ * @author Jakob Sack
+ * @copyright 2010 Frank Karlitschek karlitschek@kde.org
+ * @copyright 2011 Jakob Sack kde@jakobsack.de
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+// Do not load FS ...
+$RUNTIME_NOSETUPFS = true;
+
+// only need filesystem apps
+$RUNTIME_APPTYPES=array('filesystem','authentication');
+
+
+// Backends
+$authBackend = new OC_Connector_Sabre_Auth();
+$lockBackend = new OC_Connector_Sabre_Locks();
+
+// Create ownCloud Dir
+$publicDir = new OC_Connector_Sabre_Directory('');
+
+// Fire up server
+$server = new Sabre_DAV_Server($publicDir);
+$server->setBaseUri(OC::$WEBROOT.'/remote/webdav.php');
+
+// Load plugins
+$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
+$server->addPlugin(new Sabre_DAV_Locks_Plugin($lockBackend));
+$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/files/appinfo/update.php b/apps/files/appinfo/update.php
new file mode 100644 (file)
index 0000000..d00a1a3
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+if(!file_exists(OC::$WEBROOT.'/remote/webdav.php')){
+       file_put_contents(OC::$WEBROOT.'/remote/webdav.php', file_get_contents(OC::$APPROOT . '/apps/files/appinfo/webdav.php'));
+}
\ No newline at end of file
diff --git a/apps/files/webdav.php b/apps/files/webdav.php
deleted file mode 100644 (file)
index 940bbfe..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-
-/**
- * ownCloud
- *
- * @author Frank Karlitschek
- * @author Jakob Sack
- * @copyright 2010 Frank Karlitschek karlitschek@kde.org
- * @copyright 2011 Jakob Sack kde@jakobsack.de
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-// Do not load FS ...
-$RUNTIME_NOSETUPFS = true;
-require_once('../inc.php');
-
-// only need filesystem apps
-$RUNTIME_APPTYPES=array('filesystem','authentication');
-
-
-// Backends
-$authBackend = new OC_Connector_Sabre_Auth();
-$lockBackend = new OC_Connector_Sabre_Locks();
-
-// Create ownCloud Dir
-$publicDir = new OC_Connector_Sabre_Directory('');
-
-// Fire up server
-$server = new Sabre_DAV_Server($publicDir);
-$server->setBaseUri(OC::$APPSWEBROOT.'/apps/files/webdav.php');
-
-// Load plugins
-$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
-$server->addPlugin(new Sabre_DAV_Locks_Plugin($lockBackend));
-$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/inc.php b/apps/inc.php
deleted file mode 100644 (file)
index cbfab01..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?php require_once('/Applications/MAMP/htdocs/owncloud/lib/base.php'); ?>
\ No newline at end of file
index 9c81928e113f72fabdb0348f353b836ee8af9d1c..b9872a906d73ee8b285de40080c5b1b632f4980c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -44,7 +44,7 @@ if($not_installed) {
 
 // Handle WebDAV
 if($_SERVER['REQUEST_METHOD']=='PROPFIND'){
-       header('location: '.OC_Helper::linkToAbsolute('files','webdav.php'));
+       header('location: '.OC_Helper::linkToAbsolute('remote','webdav.php'));
        exit();
 }
 
index ff0450699e89db30f380b1a8c440fa965457258c..40df2b0c56cb3765249dc2002b90755a6fc44051 100644 (file)
@@ -451,8 +451,6 @@ class OC{
                                exit;
                        }
                }
-               //update path to lib base
-               @file_put_contents(OC::$APPSROOT . '/apps/inc.php', '<?php require_once(\'' . OC::$SERVERROOT . '/lib/base.php' . '\'); ?>');
        }
 }