summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMichiel de Jong <michiel@unhosted.org>2012-05-11 10:47:42 +0200
committerMichiel de Jong <michiel@unhosted.org>2012-05-11 10:47:42 +0200
commit02cee2c56296d0e72cfdc368c20198b36638bda9 (patch)
tree4e5516eaf6551e7b1dce24365e01b04e63eb9762 /apps
parent0c7f0aa3fa1b41f1e3a1ff15a1dbfa1a584608c3 (diff)
downloadnextcloud-server-02cee2c56296d0e72cfdc368c20198b36638bda9.tar.gz
nextcloud-server-02cee2c56296d0e72cfdc368c20198b36638bda9.zip
trying to fix /.well-known/host-meta
Diffstat (limited to 'apps')
-rw-r--r--apps/user_webfinger/host-meta.php (renamed from apps/user_webfinger/appinfo/install.php)23
1 files changed, 2 insertions, 21 deletions
diff --git a/apps/user_webfinger/appinfo/install.php b/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 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<Title>Resource Descriptor</Title>
</Link>
</XRD>";
-@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, "<filesMatch \"^host-meta$\">
-<ifModule mod_headers.c>\n");
foreach($hostMetaHeader as $header => $value) {
- fwrite($htaccess, "Header set " . $header . " \"" . $value . "\"\n");
+ header($header . ": " . $value);
}
-fwrite($htaccess, "</ifModule>\n</filesMatch>");
-fclose($htaccess);
+echo $hostMetaContents;