server/apps/user_webfinger/webfinger.php

25 lines
834 B
PHP
Raw Normal View History

2011-09-11 22:12:34 +00:00
<?php
2011-09-12 12:22:48 +00:00
if($_SERVER['SCRIPT_NAME'] == '/.well-known/host-meta.php') {
header("Access-Control-Allow-Origin: *");
} else {
header('Please-first: activate');
}
2011-09-11 22:12:34 +00:00
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 "<";
?>
2011-09-12 12:35:15 +00:00
?xml version="1.0" encoding="UTF-8"?>
2011-09-11 22:12:34 +00:00
<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>
2011-09-12 12:35:15 +00:00
<Link rel="http://unhosted.org/spec/dav/0.1" href="http<?php echo ($_SERVER['HTTPS']?'s':''); ?>://<?php echo $_SERVER['SERVER_NAME'] ?>/apps/unhosted/compat.php/<?php echo $userName ?>/unhosted/" />
2011-09-11 22:12:34 +00:00
</XRD>