mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 23:03:00 -04:00
adding webfinger app
This commit is contained in:
parent
de729d8d8b
commit
994c7f3dad
7 changed files with 52 additions and 0 deletions
1
.well-known
Symbolic link
1
.well-known
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
apps/user_webfinger/
|
||||
3
apps/user_webfinger/.htaccess
Normal file
3
apps/user_webfinger/.htaccess
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
RewriteEngine On
|
||||
RewriteBase /
|
||||
RewriteRule host-meta$ \/\.well-known\/host-meta\.php [L]
|
||||
5
apps/user_webfinger/appinfo/app.php
Normal file
5
apps/user_webfinger/appinfo/app.php
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
OC_App::register( array(
|
||||
'order' => 11,
|
||||
'id' => 'user_webfinger',
|
||||
'name' => 'Webfinger' ));
|
||||
10
apps/user_webfinger/appinfo/info.xml
Normal file
10
apps/user_webfinger/appinfo/info.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
<info>
|
||||
<id>user_webfinger</id>
|
||||
<name>Webfinger</name>
|
||||
<description>Provide webfinger for all users, so that they can use their ownCloud account as their remote storage on the web. If you don't run owncloud in the root of your domain, for instance if you run it on http://example.com/owncloud/, then makes sure you link http://example.com/.well-known/ to http://example.com/owncloud/apps/user_webfinger/ - for instance by running something like "ln -s /var/www/owncloud/apps/user_webfinger /var/www/.well-known". Only enable this app if you run this owncloud installation on a public web address, not if you run it on an intranet or on localhost.</description>
|
||||
<version>0.1</version>
|
||||
<licence>AGPL</licence>
|
||||
<author>Michiel de Jong</author>
|
||||
<require>2</require>
|
||||
</info>
|
||||
1
apps/user_webfinger/host-meta
Normal file
1
apps/user_webfinger/host-meta
Normal file
|
|
@ -0,0 +1 @@
|
|||
please run 'a2enmod rewrite' on your server
|
||||
12
apps/user_webfinger/host-meta.php
Normal file
12
apps/user_webfinger/host-meta.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Content-Type: application/xml+xrd");
|
||||
echo "<";
|
||||
?>
|
||||
?xml version="1.0" encoding="UTF-8"?>
|
||||
<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>
|
||||
<Link rel="lrdd" template="<?php echo $_SERVER['SERVER_NAME'] ?>://<?php echo $_SERVER['SERVER_NAME'] ?>/.well-known/webfinger.php?q={uri}">
|
||||
</Link>
|
||||
</XRD>
|
||||
|
||||
20
apps/user_webfinger/webfinger.php
Normal file
20
apps/user_webfinger/webfinger.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Content-Type: application/xml+xrd");
|
||||
|
||||
if($_GET['q']) {
|
||||
$bits = explode('@', $_GET['q']);
|
||||
$userName = $bits[0];
|
||||
} else {
|
||||
$userName = '';
|
||||
}
|
||||
if(substr($userName, 0, 5) == 'acct:') {
|
||||
$userName = substr($userName, 5);
|
||||
}
|
||||
echo "<";
|
||||
?>
|
||||
xml version="1.0" encoding="UTF-8"?>
|
||||
<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>
|
||||
<Link rel="http://unhosted.org/spec/dav/0.1" href="<?php echo $_SERVER['SERVER_NAME'] ?>://<?php echo $_SERVER['SERVER_NAME'] ?>/apps/unhosted/compat.php/<?php echo $userName ?>/unhosted/"></Link>
|
||||
</XRD>
|
||||
Loading…
Reference in a new issue