diff --git a/.htaccess b/.htaccess index adc6667d5b..fd1f6abb96 100644 --- a/.htaccess +++ b/.htaccess @@ -1,9 +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 +Redirect 301 /apps/calendar/caldav.php /remote.php/caldav/ +Redirect 301 /apps/contacts/carddav.php /remote.php/carddav/ +Redirect 301 /apps/files/webdav.php /remote.php/webdav/ +Redirect 301 /files/webdav.php /remote.php/webdav/ php_value upload_max_filesize 512M php_value post_max_size 512M @@ -15,9 +15,10 @@ php_value memory_limit 512M RewriteEngine on RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] -RewriteRule ^.well-known/carddav /remote/carddav.php [R] -RewriteRule ^.well-known/caldav /remote/caldav.php [R] +RewriteRule ^.well-known/carddav /remote.php/carddav/ [R] +RewriteRule ^.well-known/caldav /remote.php/caldav/ [R] RewriteRule ^apps/([^/]*)/(.*\.(css|php))$ index.php?app=$1&getfile=$2 [QSA,L] +RewriteRule ^remote/(.*) remote.php [QSA,L] Options -Indexes diff --git a/3rdparty/Sabre/DAV/Server.php b/3rdparty/Sabre/DAV/Server.php index 4284c127b6..50b190e8fa 100644 --- a/3rdparty/Sabre/DAV/Server.php +++ b/3rdparty/Sabre/DAV/Server.php @@ -215,7 +215,7 @@ class Sabre_DAV_Server { $DOM->appendChild($error); $error->appendChild($DOM->createElement('s:exception',get_class($e))); - $error->appendChild($DOM->createElement('s:message',$e->getMessage())); + $error->appendChild($DOM->createElement('s:message',htmlentities($e->getMessage()))); if ($this->debugExceptions) { $error->appendChild($DOM->createElement('s:file',$e->getFile())); $error->appendChild($DOM->createElement('s:line',$e->getLine())); diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php index 055066de0d..297d8e44b6 100755 --- a/apps/calendar/appinfo/app.php +++ b/apps/calendar/appinfo/app.php @@ -23,6 +23,4 @@ OCP\App::addNavigationEntry( array( 'name' => $l->t('Calendar'))); OCP\App::registerPersonal('calendar', 'settings'); OC_Search::registerProvider('OC_Search_Provider_Calendar'); -if(!file_exists(OC::$SERVERROOT.'/remote/caldav.php')){ - file_put_contents(OC::$SERVERROOT.'/remote/caldav.php', file_get_contents(OC::$APPSROOT . '/apps/calendar/appinfo/remote.php')); -} \ No newline at end of file +OCP\CONFIG::setAppValue('core', 'caldav', '/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 index 32b454ee90..7ff6a2fbbe 100755 --- a/apps/calendar/appinfo/remote.php +++ b/apps/calendar/appinfo/remote.php @@ -5,10 +5,6 @@ * later. * See the COPYING-README file. */ -// Do not load FS ... -$RUNTIME_NOSETUPFS = true; -require_once('../lib/base.php'); - OCP\App::checkAppEnabled('calendar'); // Backends @@ -24,7 +20,7 @@ $nodes = array( // Fire up server $server = new Sabre_DAV_Server($nodes); -$server->setBaseUri(OC::$WEBROOT.'/remote/caldav.php'); +$server->setBaseUri($baseuri); // Add plugins $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud')); $server->addPlugin(new Sabre_CalDAV_Plugin()); diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php index 7e767e3673..19c9a4d8d7 100755 --- a/apps/calendar/templates/calendar.php +++ b/apps/calendar/templates/calendar.php @@ -19,7 +19,7 @@ var missing_field_totime = 't('To Time')) ?>'; var missing_field_startsbeforeends = 't('The event ends before it starts')) ?>'; var missing_field_dberror = 't('There was a database fail')) ?>'; - var totalurl = '/calendars'; + var totalurl = '/calendars'; var firstDay = ''; $(document).ready(function() { t('Calendar CalDAV syncing address:');?> -
+
diff --git a/apps/contacts/appinfo/app.php b/apps/contacts/appinfo/app.php index c8c1d779da..216e89d5c0 100755 --- a/apps/contacts/appinfo/app.php +++ b/apps/contacts/appinfo/app.php @@ -25,6 +25,4 @@ OCP\App::addNavigationEntry( array( OCP\App::registerPersonal('contacts','settings'); OCP\Util::addscript('contacts', 'loader'); OC_Search::registerProvider('OC_Search_Provider_Contacts'); -if(!file_exists(OC::$SERVERROOT.'/remote/carddav.php')){ - file_put_contents(OC::$SERVERROOT.'/remote/carddav.php', file_get_contents(OC::$APPSROOT . '/apps/contacts/appinfo/remote.php')); -} \ No newline at end of file +OCP\CONFIG::setAppValue('core', 'carddav', '/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 index 804c560e3d..67006b77f9 100755 --- a/apps/contacts/appinfo/remote.php +++ b/apps/contacts/appinfo/remote.php @@ -19,9 +19,6 @@ * License along with this library. If not, see . * */ -// Do not load FS ... -$RUNTIME_NOSETUPFS = true; -require_once('../lib/base.php'); OCP\App::checkAppEnabled('contacts'); @@ -38,7 +35,7 @@ $nodes = array( // Fire up server $server = new Sabre_DAV_Server($nodes); -$server->setBaseUri(OC::$WEBROOT.'/remote/carddav.php'); +$server->setBaseUri($baseuri); // Add plugins $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud')); $server->addPlugin(new Sabre_CardDAV_Plugin()); diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php index c28b47e7c2..791e3ced26 100755 --- a/apps/contacts/templates/index.php +++ b/apps/contacts/templates/index.php @@ -1,5 +1,5 @@ diff --git a/apps/contacts/templates/settings.php b/apps/contacts/templates/settings.php index 9dffdfb0e4..ce14e52e0c 100755 --- a/apps/contacts/templates/settings.php +++ b/apps/contacts/templates/settings.php @@ -4,9 +4,9 @@ t('CardDAV syncing addresses'); ?> (t('more info'); ?>)
t('Primary address (Kontact et al)'); ?>
-
/
+
t('iOS/OS X'); ?>
-
/principals//
+
principals//
Powered by geonames.org webservice diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php index 3f4e1705fb..2cc2d48602 100755 --- a/apps/files/appinfo/app.php +++ b/apps/files/appinfo/app.php @@ -1,6 +1,4 @@ 2, "id" => "files", "name" => "Files" )); @@ -9,6 +7,4 @@ OCP\App::registerAdmin('files','admin'); OCP\App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") )); OC_Search::registerProvider('OC_Search_Provider_File'); -if(!file_exists(OC::$SERVERROOT.'/remote/webdav.php')){ - file_put_contents(OC::$SERVERROOT.'/remote/webdav.php', file_get_contents(OC::$APPSROOT . '/apps/files/appinfo/remote.php')); -} \ No newline at end of file +OCP\CONFIG::setAppValue('core', 'webdav', '/apps/files/appinfo/remote.php'); \ No newline at end of file diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php index defb97ab15..465e0c0a93 100644 --- a/apps/files/appinfo/remote.php +++ b/apps/files/appinfo/remote.php @@ -22,12 +22,8 @@ * License along with this library. If not, see . * */ - -// Do not load FS ... -$RUNTIME_NOSETUPFS = true; // only need filesystem apps $RUNTIME_APPTYPES=array('filesystem','authentication'); -require_once('../lib/base.php'); // Backends $authBackend = new OC_Connector_Sabre_Auth(); @@ -38,7 +34,7 @@ $publicDir = new OC_Connector_Sabre_Directory(''); // Fire up server $server = new Sabre_DAV_Server($publicDir); -$server->setBaseUri(OC::$WEBROOT.'/remote/webdav.php'); +$server->setBaseUri($baseuri); // Load plugins $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud')); diff --git a/index.php b/index.php index 91f0cfb5e4..b0b77969c5 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('remote','webdav.php')); + header('location: '.OC_Helper::linkToAbsolute('remote.php','webdav/')); exit(); } diff --git a/remote.php b/remote.php new file mode 100644 index 0000000000..db2d1756f7 --- /dev/null +++ b/remote.php @@ -0,0 +1,16 @@ + WebDAV -
+
t('use this address to connect to your ownCloud in your file manager');?>