server/apps/user_webfinger/webfinger.php
2011-09-12 00:12:34 +02:00

20 lines
721 B
PHP

<?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>