]> git.mxchange.org Git - friendica.git/blob - src/Module/Debug/WebFinger.php
Group selection: Respect "pubmail" and ignore atchived or blocked contacts
[friendica.git] / src / Module / Debug / WebFinger.php
1 <?php
2
3 namespace Friendica\Module\Debug;
4
5 use Friendica\BaseModule;
6 use Friendica\Core\L10n;
7 use Friendica\Core\Renderer;
8 use Friendica\Network\Probe;
9
10 /**
11  * Web based module to perform webfinger probing
12  */
13 class WebFinger extends BaseModule
14 {
15         public static function content(array $parameters = [])
16         {
17                 if (!local_user()) {
18                         $e           = new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.'));
19                         $e->httpdesc = L10n::t('Public access denied.');
20                         throw $e;
21                 }
22
23                 $addr = $_GET['addr'] ?? '';
24                 $res  = '';
25
26                 if (!empty($addr)) {
27                         $res = Probe::lrdd($addr);
28                         $res = print_r($res, true);
29                 }
30
31                 $tpl = Renderer::getMarkupTemplate('webfinger.tpl');
32                 return Renderer::replaceMacros($tpl, [
33                         '$addr' => $addr,
34                         '$res'  => $res,
35                 ]);
36         }
37 }