]> git.mxchange.org Git - friendica.git/blob - mod/webfinger.php
The central item fetch does work now and the API now uses these functions
[friendica.git] / mod / webfinger.php
1 <?php
2 /**
3  * @file mod/webfinger.php
4  */
5 use Friendica\App;
6 use Friendica\Core\L10n;
7 use Friendica\Core\System;
8 use Friendica\Network\Probe;
9
10 function webfinger_content(App $a)
11 {
12         if (!local_user()) {
13                 System::httpExit(
14                         403,
15                         [
16                                 "title" => L10n::t("Public access denied."),
17                                 "description" => L10n::t("Only logged in users are permitted to perform a probing.")
18                         ]
19                 );
20                 killme();
21         }
22
23         $o  = '<h3>Webfinger Diagnostic</h3>';
24
25         $o .= '<form action="webfinger" method="get">';
26         $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />';
27         $o .= '<input type="submit" name="submit" value="Submit" /></form>';
28
29         $o .= '<br /><br />';
30
31         if (x($_GET, 'addr')) {
32                 $addr = trim($_GET['addr']);
33                 $res = Probe::lrdd($addr);
34                 $o .= '<pre>';
35                 $o .= str_replace("\n", '<br />', print_r($res, true));
36                 $o .= '</pre>';
37         }
38         return $o;
39 }