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