diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-05-02 16:41:00 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-05-02 16:41:23 +0200 |
commit | da03d057007d885914dfac7c92cca51747b5f44b (patch) | |
tree | 042198fa223b761710480fdc96466649fae321d6 | |
parent | c536e930f40f1bf4dd551ca6fefca15b2f88eee7 (diff) | |
download | nextcloud-server-da03d057007d885914dfac7c92cca51747b5f44b.tar.gz nextcloud-server-da03d057007d885914dfac7c92cca51747b5f44b.zip |
create folder 'remote' for the remote services like caldav, carddav and webdav
-rw-r--r-- | .htaccess | 10 | ||||
-rw-r--r-- | apps/calendar/appinfo/install.php | 4 | ||||
-rw-r--r-- | apps/calendar/appinfo/remote.php (renamed from apps/calendar/caldav.php) | 5 | ||||
-rwxr-xr-x | apps/calendar/appinfo/update.php | 3 | ||||
-rw-r--r-- | apps/contacts/appinfo/install.php | 4 | ||||
-rw-r--r-- | apps/contacts/appinfo/remote.php (renamed from apps/contacts/carddav.php) | 5 | ||||
-rw-r--r-- | apps/contacts/appinfo/update.php | 4 | ||||
-rw-r--r-- | apps/files/appinfo/install.php | 4 | ||||
-rw-r--r-- | apps/files/appinfo/remote.php (renamed from apps/files/webdav.php) | 3 | ||||
-rw-r--r-- | apps/files/appinfo/update.php | 4 | ||||
-rw-r--r-- | apps/inc.php | 1 | ||||
-rw-r--r-- | index.php | 2 | ||||
-rw-r--r-- | lib/base.php | 2 |
13 files changed, 36 insertions, 15 deletions
diff --git a/.htaccess b/.htaccess index 96ecb685d52..100975ef4cb 100644 --- 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 index 00000000000..c5a9a72f26f --- /dev/null +++ b/apps/calendar/appinfo/install.php @@ -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/caldav.php b/apps/calendar/appinfo/remote.php index 7210b25879f..2fbb973d5cb 100644 --- a/apps/calendar/caldav.php +++ b/apps/calendar/appinfo/remote.php @@ -5,10 +5,9 @@ * later. * See the COPYING-README file. */ - // Do not load FS ... $RUNTIME_NOSETUPFS = true; -require_once('../inc.php'); +require_once('../lib/base.php'); OC_Util::checkAppEnabled('calendar'); @@ -25,7 +24,7 @@ $nodes = array( // Fire up server $server = new Sabre_DAV_Server($nodes); -$server->setBaseUri(OC::$APPSWEBROOT.'/apps/calendar/caldav.php'); +$server->setBaseUri(OC::$WEBROOT.'/remote/caldav.php'); // Add plugins $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud')); $server->addPlugin(new Sabre_CalDAV_Plugin()); 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/contacts/appinfo/install.php b/apps/contacts/appinfo/install.php new file mode 100644 index 00000000000..b87241b2db1 --- /dev/null +++ b/apps/contacts/appinfo/install.php @@ -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/appinfo/remote.php index 1a11ccdb3f7..3ffdb64b52b 100644 --- a/apps/contacts/carddav.php +++ b/apps/contacts/appinfo/remote.php @@ -19,10 +19,9 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ - // Do not load FS ... $RUNTIME_NOSETUPFS = true; -require_once('../inc.php'); +require_once('../lib/base.php'); OC_Util::checkAppEnabled('contacts'); @@ -39,7 +38,7 @@ $nodes = array( // Fire up server $server = new Sabre_DAV_Server($nodes); -$server->setBaseUri(OC::$APPSWEBROOT.'/apps/contacts/carddav.php'); +$server->setBaseUri(OC::$WEBROOT.'/remote/carddav.php'); // Add plugins $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud')); $server->addPlugin(new Sabre_CardDAV_Plugin()); diff --git a/apps/contacts/appinfo/update.php b/apps/contacts/appinfo/update.php new file mode 100644 index 00000000000..b87241b2db1 --- /dev/null +++ b/apps/contacts/appinfo/update.php @@ -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/files/appinfo/install.php b/apps/files/appinfo/install.php new file mode 100644 index 00000000000..d00a1a321eb --- /dev/null +++ b/apps/files/appinfo/install.php @@ -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/appinfo/remote.php index 940bbfef52e..232a61ed944 100644 --- a/apps/files/webdav.php +++ b/apps/files/appinfo/remote.php @@ -25,7 +25,6 @@ // Do not load FS ... $RUNTIME_NOSETUPFS = true; -require_once('../inc.php'); // only need filesystem apps $RUNTIME_APPTYPES=array('filesystem','authentication'); @@ -41,7 +40,7 @@ $publicDir = new OC_Connector_Sabre_Directory(''); // Fire up server $server = new Sabre_DAV_Server($publicDir); -$server->setBaseUri(OC::$APPSWEBROOT.'/apps/files/webdav.php'); +$server->setBaseUri(OC::$WEBROOT.'/remote/webdav.php'); // Load plugins $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud')); diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php new file mode 100644 index 00000000000..d00a1a321eb --- /dev/null +++ b/apps/files/appinfo/update.php @@ -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/inc.php b/apps/inc.php deleted file mode 100644 index cbfab014173..00000000000 --- a/apps/inc.php +++ /dev/null @@ -1 +0,0 @@ -<?php require_once('/Applications/MAMP/htdocs/owncloud/lib/base.php'); ?>
\ No newline at end of file diff --git a/index.php b/index.php index 9c81928e113..b9872a906d7 100644 --- 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(); } diff --git a/lib/base.php b/lib/base.php index ff0450699e8..40df2b0c56c 100644 --- a/lib/base.php +++ b/lib/base.php @@ -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' . '\'); ?>'); } } |