]> source.dussan.org Git - nextcloud-server.git/commitdiff
check activation and make activation impossible by default
authorMichiel@unhosted <michiel@unhosted.org>
Mon, 12 Sep 2011 12:15:19 +0000 (14:15 +0200)
committerMichiel@unhosted <michiel@unhosted.org>
Mon, 12 Sep 2011 12:15:19 +0000 (14:15 +0200)
apps/user_webfinger/activate.php
apps/user_webfinger/host-meta.php

index 6302ca0fa7c7bd7392622af74e91b03d414ce10f..547c8e54d32c2c8be1308900425e7ecb216b0e2c 100644 (file)
@@ -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";
 }
index eec473e494e09631e52c5d02f211ceaa31bed330..c37b7dd77693f453884156604257f7a8239f87b4 100644 (file)
@@ -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 "<";
 ?>