summaryrefslogtreecommitdiffstats
path: root/apps/user_webfinger
diff options
context:
space:
mode:
authorMichiel@unhosted <michiel@unhosted.org>2011-09-12 14:15:19 +0200
committerMichiel@unhosted <michiel@unhosted.org>2011-09-12 14:15:19 +0200
commitf93be510a358689d726bf50b5d6989159b05cda2 (patch)
tree12c9bdb0f4d6cd4d548fdd8457b94e43faec8b6b /apps/user_webfinger
parentd07f3d548c6e1d5e72011175afef93de104cc4d8 (diff)
downloadnextcloud-server-f93be510a358689d726bf50b5d6989159b05cda2.tar.gz
nextcloud-server-f93be510a358689d726bf50b5d6989159b05cda2.zip
check activation and make activation impossible by default
Diffstat (limited to 'apps/user_webfinger')
-rw-r--r--apps/user_webfinger/activate.php11
-rw-r--r--apps/user_webfinger/host-meta.php6
2 files changed, 14 insertions, 3 deletions
diff --git a/apps/user_webfinger/activate.php b/apps/user_webfinger/activate.php
index 6302ca0fa7c..547c8e54d32 100644
--- a/apps/user_webfinger/activate.php
+++ b/apps/user_webfinger/activate.php
@@ -1,11 +1,18 @@
<?php
+
+// comment out this line:
+ die("This feature is still experimental. Please comment out this line in the code, then try again\n");
+//
+
+
+
$ownCloudBaseUri = substr($_SERVER['REQUEST_URI'],0, -(strlen('/apps/user_webfinger/activate.php')));
$thisAppDir = __DIR__;
$appsDir = dirname($thisAppDir);
$ownCloudDir = dirname($appsDir);
try{
symlink($thisAppDir, $ownCloudDir.'/.well-known');
- echo "Webfinger should now work.";
+ echo "Webfinger should now work.\n";
} catch(Exception $e) {
- echo "Please create a file called '.well-known in the ownCloud root, give the web server user permission to change it, and retry;";
+ echo "Please create a file called '.well-known in the ownCloud root, give the web server user permission to change it, and retry.\n";
}
diff --git a/apps/user_webfinger/host-meta.php b/apps/user_webfinger/host-meta.php
index eec473e494e..c37b7dd7769 100644
--- a/apps/user_webfinger/host-meta.php
+++ b/apps/user_webfinger/host-meta.php
@@ -1,5 +1,9 @@
<?php
-header("Access-Control-Allow-Origin: *");
+if($_SERVER['SCRIPT_NAME'] == '/.well-known/host-meta.php') {
+ header("Access-Control-Allow-Origin: *");
+} else {
+ header('Please visit /apps/user_webfinger/activate.php first');
+}
header("Content-Type: application/xml+xrd");
echo "<";
?>