create folder 'remote' for the remote services like caldav, carddav and webdav

This commit is contained in:
Georg Ehrke 2012-05-02 16:41:00 +02:00
parent c536e930f4
commit da03d05700
13 changed files with 36 additions and 15 deletions

View File

@ -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

View File

@ -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'));
}

View File

@ -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());

View File

@ -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'));
}

View File

@ -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'));
}

View File

@ -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());

View File

@ -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'));
}

View File

@ -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'));
}

View File

@ -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'));

View File

@ -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'));
}

View File

@ -1 +0,0 @@
<?php require_once('/Applications/MAMP/htdocs/owncloud/lib/base.php'); ?>

View File

@ -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();
}

View 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' . '\'); ?>');
}
}