From 8d442e6fc1364ea351a9b781e8173c1b679b7a91 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 4 Mar 2013 20:58:39 -0800 Subject: fix timeago (again), webfinger new spec implemented, some theme work --- mod/_well_known.php | 8 +++++ mod/follow.php | 8 ++++- mod/wfinger.php | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 mod/wfinger.php (limited to 'mod') diff --git a/mod/_well_known.php b/mod/_well_known.php index 5c5f6585f..184f75593 100644 --- a/mod/_well_known.php +++ b/mod/_well_known.php @@ -17,6 +17,14 @@ function _well_known_init(&$a){ zfinger_init($a); break; + case 'webfinger': + $a->argc -= 1; + array_shift($a->argv); + $a->argv[0] = 'wfinger'; + require_once('mod/wfinger.php'); + wfinger_init($a); + break; + } } diff --git a/mod/follow.php b/mod/follow.php index c07c210f6..05a12d0f0 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -6,7 +6,6 @@ require_once('include/follow.php'); function follow_init(&$a) { if(! local_user()) { - notice( t('Permission denied.') . EOL); return; } @@ -27,3 +26,10 @@ function follow_init(&$a) { goaway(z_root() . '/connections/' . $result['abook']['abook_id']); } + +functon follow_content(&$a) { + + if(! local_user()) { + return login(); + } +} \ No newline at end of file diff --git a/mod/wfinger.php b/mod/wfinger.php new file mode 100644 index 000000000..3fda96181 --- /dev/null +++ b/mod/wfinger.php @@ -0,0 +1,101 @@ +get_hostname(), + z_root() . '/channel/' . $r[0]['channel_address'], + z_root() . '/~' . $r[0]['channel_address'] + ); + + $result['aliases'] = array(); + + foreach($aliases as $alias) + if($alias != $resource) + $result['aliases'][] = $alias; + + + $result['links'] = array( + + array( + 'rel' => 'http://webfinger.example/rel/avatar', + 'type' => $r[0]['xchan_photo_mimetype'], + 'href' => $r[0]['xchan_photo_l'] + ), + + array( + 'rel' => 'http://webfinger.example/rel/profile-page', + 'href' => z_root() . '/profile/' . $r[0]['channel_address'], + ), + + array( + 'rel' => 'http://webfinger.example/rel/blog', + 'href' => z_root() . '/channel/' . $r[0]['channel_address'], + ), + + array( + 'rel' => 'http://purl.org/zot/protocol', + 'href' => z_root() . '/well-known/zot-info' . '?zaddr=' . $r[0]['xchan_addr'], + ) + ); + + } + else { + header($_SERVER["SERVER_PROTOCOL"] . ' ' . 400 . ' ' . 'Bad Request'); + killme(); + } + + $arr = array('channel' => $r[0], 'request' => $_REQUEST, 'result' => $result); + call_hooks('webfinger',$arr); + + echo json_encode($arr['result']); + killme(); + +} \ No newline at end of file -- cgit v1.2.3