]> source.dussan.org Git - nextcloud-server.git/commitdiff
move lrdd to jrd
authorMichiel de Jong <michiel@unhosted.org>
Fri, 11 May 2012 13:26:45 +0000 (15:26 +0200)
committerMichiel de Jong <michiel@unhosted.org>
Fri, 11 May 2012 13:26:45 +0000 (15:26 +0200)
apps/remoteStorage/appinfo/webfinger.php
apps/user_webfinger/webfinger.php

index 1cb2d45ee7ac60bef50778f5c47081a456f8693a..5d481f315f885f80950b83f7e808723890c03c09 100644 (file)
@@ -1,8 +1,8 @@
 <?php if(OC_User::userExists(WF_USER)) { ?>
-    <Link
-        rel="remoteStorage"
-        template="<?php echo WF_BASEURL; ?>/apps/remoteStorage/WebDAV.php/<?php echo WF_USER; ?>/remoteStorage/{category}/"
-        api="WebDAV"
-        auth="<?php echo WF_BASEURL; ?>/?app=remoteStorage&getfile=auth.php&userid=<?php echo WF_USER; ?>">
-    </Link>
+    {
+        "rel":"remoteStorage",
+        "template":"<?php echo WF_BASEURL; ?>/apps/remoteStorage/WebDAV.php/<?php echo WF_USER; ?>/remoteStorage/{category}/",
+        "api":"WebDAV",
+        "auth":"<?php echo WF_BASEURL; ?>/?app=remoteStorage&getfile=auth.php&userid=<?php echo WF_USER; ?>"
+    }
 <?php } ?>
index 4ea9b80c98ce9533c6f61678f3b5bf5ddf2a2e08..e75c546c2cb8017b5f79c4dcb68b4aaed42e09af 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
 header("Access-Control-Allow-Origin: *");
-header("Content-Type: application/xrd+xml");
+header("Content-Type: application/xrd+json");
 
 /**
  * To include your app in the webfinger XML, add a new script with file name
@@ -55,14 +55,7 @@ if(empty($id)) {
 define('WF_USER', $userName);
 define('WF_ID', $id);
 define('WF_BASEURL', $baseAddress);
-echo "<";
-?>
-?xml version="1.0" encoding="UTF-8"?>
-<?php if(empty($id)) echo '<!-- Invalid URI: ' . str_replace('>', '/>', $request) . " -->\n"; ?>
-<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" xmlns:hm="http://host-meta.net/xrd/1.0">
-    <hm:Host xmlns="http://host-meta.net/xrd/1.0"><?php echo $_SERVER['SERVER_NAME']; ?></hm:Host>
-    <Subject>acct:<?php echo $id ?></Subject>
-<?php
+echo "{\"links\":[";
 $apps = OC_Appconfig::getApps();
 foreach($apps as $app) {
        if(OCP\App::isEnabled($app)) {
@@ -71,5 +64,5 @@ foreach($apps as $app) {
                }
        }
 }
+echo "]}";
 ?>
-</XRD>