diff options
author | mrjive <mrjive@mrjive.it> | 2015-09-17 09:27:13 +0200 |
---|---|---|
committer | mrjive <mrjive@mrjive.it> | 2015-09-17 09:27:13 +0200 |
commit | 024af91df82b4bb14983c53ae319ba9d348773d6 (patch) | |
tree | e2c0fa8ae7827ebea20db24264dbacbcd1495edd /mod/wfinger.php | |
parent | 4c5a74284bb1c2e23ef1e40c09d10f3449f8c853 (diff) | |
parent | 5d33b34be7fe1a4c89d43a4bdab5c4e6b35a61bc (diff) | |
download | volse-hubzilla-024af91df82b4bb14983c53ae319ba9d348773d6.tar.gz volse-hubzilla-024af91df82b4bb14983c53ae319ba9d348773d6.tar.bz2 volse-hubzilla-024af91df82b4bb14983c53ae319ba9d348773d6.zip |
Merge pull request #1 from redmatrix/master
updating from original codebase
Diffstat (limited to 'mod/wfinger.php')
-rw-r--r-- | mod/wfinger.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/mod/wfinger.php b/mod/wfinger.php index c61a97b30..7b9eaa461 100644 --- a/mod/wfinger.php +++ b/mod/wfinger.php @@ -18,6 +18,8 @@ function wfinger_init(&$a) { killme(); } + $zot = intval($_REQUEST['zot']); + $resource = $_REQUEST['resource']; logger('webfinger: ' . $resource,LOGGER_DEBUG); @@ -30,7 +32,7 @@ function wfinger_init(&$a) { if(strpos($channel,'@') !== false) { $host = substr($channel,strpos($channel,'@')+1); if(strcasecmp($host,get_app()->get_hostname())) { - goaway('https://' . $host . '/.well-known/webfinger?resource=' . $resource); + goaway('https://' . $host . '/.well-known/webfinger?f=&resource=' . $resource . (($zot) ? '&zot=' . $zot : '')); } $channel = substr($channel,0,strpos($channel,'@')); } @@ -52,10 +54,9 @@ function wfinger_init(&$a) { header('Content-type: application/jrd+json'); - if($resource && $r) { - $h = q("select hubloc_addr from hubloc where hubloc_hash = '%s'", + $h = q("select hubloc_addr from hubloc where hubloc_hash = '%s' and hubloc_deleted = 0", dbesc($r[0]['channel_hash']) ); @@ -105,6 +106,13 @@ function wfinger_init(&$a) { ) ); + if($zot) { + // @FIXME do a lookup straightaway and return the zot-info packet + + $_REQUEST['address'] = $r[0]['xchan_address']; + + + } } else { header($_SERVER["SERVER_PROTOCOL"] . ' ' . 400 . ' ' . 'Bad Request'); |