]> git.mxchange.org Git - friendica.git/blob - mod/webfinger.php
Merge pull request #6977 from annando/fix-reshare
[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                 exit();
21         }
22
23         $o = '<div class="generic-page-wrapper">';
24         $o .= '<h3>Webfinger Diagnostic</h3>';
25
26         $o .= '<form action="webfinger" method="get">';
27         $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . defaults($_GET, 'addr', '') .'" />';
28         $o .= '<input type="submit" name="submit" value="Submit" /></form>';
29
30         $o .= '<br /><br />';
31
32         if (!empty($_GET['addr'])) {
33                 $addr = trim($_GET['addr']);
34                 $res = Probe::lrdd($addr);
35                 $o .= '<pre>';
36                 $o .= str_replace("\n", '<br />', print_r($res, true));
37                 $o .= '</pre>';
38         }
39         $o .= '</div>';
40
41         return $o;
42 }