From 02cee2c56296d0e72cfdc368c20198b36638bda9 Mon Sep 17 00:00:00 2001 From: Michiel de Jong Date: Fri, 11 May 2012 10:47:42 +0200 Subject: [PATCH] trying to fix /.well-known/host-meta --- .htaccess | 3 ++- .../{appinfo/install.php => host-meta.php} | 23 ++----------------- 2 files changed, 4 insertions(+), 22 deletions(-) rename apps/user_webfinger/{appinfo/install.php => host-meta.php} (59%) diff --git a/.htaccess b/.htaccess index 65d4ceafb05..69dddc9abb6 100644 --- a/.htaccess +++ b/.htaccess @@ -15,9 +15,10 @@ php_value memory_limit 512M RewriteEngine on RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] +RewriteRule ^.well-known/host-meta /public.php?service=host-meta [QSA,L] 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 \ No newline at end of file +Options -Indexes diff --git a/apps/user_webfinger/appinfo/install.php b/apps/user_webfinger/host-meta.php similarity index 59% rename from apps/user_webfinger/appinfo/install.php rename to apps/user_webfinger/host-meta.php index 00a533e781b..30072a728b9 100644 --- a/apps/user_webfinger/appinfo/install.php +++ b/apps/user_webfinger/host-meta.php @@ -3,9 +3,6 @@ $hostMetaHeader = array( 'Access-Control-Allow-Origin' => '*', 'Content-Type' => 'application/xml+xrd' ); -$appInfoDir = __DIR__; -$thisAppDir = dirname($appInfoDir); -$appsDir = dirname($thisAppDir); $ownCloudDir = dirname($appsDir); $docRoot = $_SERVER['DOCUMENT_ROOT']; try { @@ -29,23 +26,7 @@ $hostMetaContents = " Resource Descriptor "; -@mkdir($hostMetaDir); -$hostMeta = fopen($hostMetaPath, 'w'); -if(!$hostMeta) { - die("Could not open " . $hostMetaPath . " for writing, please check permissions!"); -} -if(!fwrite($hostMeta, $hostMetaContents, strlen($hostMetaContents))) { - die("Could not write to " . $hostMetaPath . ", please check permissions!"); -} -fclose($hostMeta); - -// write custom headers into .htaccess: -$htaccess = fopen($hostMetaDir . '/.htaccess', 'w'); -//TODO: check compatibility! -fwrite($htaccess, " -\n"); foreach($hostMetaHeader as $header => $value) { - fwrite($htaccess, "Header set " . $header . " \"" . $value . "\"\n"); + header($header . ": " . $value); } -fwrite($htaccess, "\n"); -fclose($htaccess); +echo $hostMetaContents; -- 2.39.5