diff --git a/apps/dav/appinfo/info.xml b/apps/dav/appinfo/info.xml index b7c7267dce8d951a101658446db718ff2a062942..a8e7df6e8e2d9f9fe64b6cd69b00e89450a59f68 100644 --- a/apps/dav/appinfo/info.xml +++ b/apps/dav/appinfo/info.xml @@ -10,17 +10,6 @@ <types> <filesystem/> </types> - <remote> - <files>appinfo/v1/webdav.php</files> - <webdav>appinfo/v1/webdav.php</webdav> - <dav>appinfo/v2/remote.php</dav> - <!-- carddav endpoints as used before ownCloud 9.0 --> - <contacts>appinfo/v1/carddav.php</contacts> - <carddav>appinfo/v1/carddav.php</carddav> - <!-- caldav endpoints as used before ownCloud 9.0 --> - <calendar>appinfo/v1/caldav.php</calendar> - <caldav>appinfo/v1/caldav.php</caldav> - </remote> <public> <webdav>appinfo/v1/publicwebdav.php</webdav> </public> diff --git a/remote.php b/remote.php index df229eb675a6c8fd7985b9601c1d2bba732b8a1e..86b47629d739a55ecaf7a38267df68cf882a26c8 100644 --- a/remote.php +++ b/remote.php @@ -84,6 +84,27 @@ function handleException(Exception $e) { } } +/** + * @param $service + * @return string + */ +function resolveService($service) { + $services = [ + 'webdav' => 'dav/appinfo/v1/webdav.php', + 'dav' => 'dav/appinfo/v2/remote.php', + 'caldav' => 'dav/appinfo/v1/caldav.php', + 'calendar' => 'dav/appinfo/v1/caldav.php', + 'carddav' => 'dav/appinfo/v1/carddav.php', + 'contacts' => 'dav/appinfo/v1/carddav.php', + 'files' => 'dav/appinfo/v1/webdav.php', + ]; + if (isset($services[$service])) { + return $services[$service]; + } + + return \OC::$server->getConfig()->getAppValue('core', 'remote_' . $service); +} + try { require_once 'lib/base.php'; @@ -103,7 +124,7 @@ try { } $service=substr($pathInfo, 1, $pos-1); - $file = \OC::$server->getConfig()->getAppValue('core', 'remote_' . $service); + $file = resolveService($service); if(is_null($file)) { throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND);