aboutsummaryrefslogtreecommitdiffstats
path: root/mod/wfinger.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-09-17 17:51:31 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-09-17 17:51:31 -0700
commitf0a7a6a1e2517494622206f06b1c21648daf43c7 (patch)
treea8f8751bbfdf0417f40b3cd1481f300d4b708f95 /mod/wfinger.php
parent4090843fef6defa88bee36c4547b418f1e818139 (diff)
downloadvolse-hubzilla-f0a7a6a1e2517494622206f06b1c21648daf43c7.tar.gz
volse-hubzilla-f0a7a6a1e2517494622206f06b1c21648daf43c7.tar.bz2
volse-hubzilla-f0a7a6a1e2517494622206f06b1c21648daf43c7.zip
consolidate zotfinger and webfinger
Diffstat (limited to 'mod/wfinger.php')
-rw-r--r--mod/wfinger.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/mod/wfinger.php b/mod/wfinger.php
index 7b9eaa461..8b9abe4af 100644
--- a/mod/wfinger.php
+++ b/mod/wfinger.php
@@ -1,5 +1,7 @@
<?php
+require_once('include/zot.php');
+
function wfinger_init(&$a) {
$result = array();
@@ -11,14 +13,13 @@ function wfinger_init(&$a) {
elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443))
$scheme = 'https';
- // Don't complain to me - I'm just implementing the spec.
+ $zot = intval($_REQUEST['zot']);
- if($scheme !== 'https') {
+ if(($scheme !== 'https') && (! $zot)) {
header($_SERVER["SERVER_PROTOCOL"] . ' ' . 500 . ' ' . 'Webfinger requires HTTPS');
killme();
}
- $zot = intval($_REQUEST['zot']);
$resource = $_REQUEST['resource'];
logger('webfinger: ' . $resource,LOGGER_DEBUG);
@@ -48,7 +49,6 @@ function wfinger_init(&$a) {
}
-
header('Access-Control-Allow-Origin: *');
header('Content-type: application/jrd+json');
@@ -107,11 +107,8 @@ function wfinger_init(&$a) {
);
if($zot) {
- // @FIXME do a lookup straightaway and return the zot-info packet
-
- $_REQUEST['address'] = $r[0]['xchan_address'];
-
-
+ // get a zotinfo packet and return it with webfinger
+ $result['zot'] = zotinfo(array('address' => $r[0]['xchan_addr']));
}
}
else {