streams/Zotlabs/Module/Finger.php

37 lines
736 B
PHP
Raw Normal View History

2018-05-18 10:09:38 +00:00
<?php
2019-04-15 05:31:07 +00:00
namespace Zotlabs\Module;
2018-05-18 10:09:38 +00:00
2019-04-15 05:31:07 +00:00
/*
* Finger diagnostic tool.
* Input a webfinger resource via an input form and
* view the results as an array.
*
*/
2018-05-18 10:09:38 +00:00
2019-04-15 05:31:07 +00:00
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Webfinger;
2018-05-18 10:09:38 +00:00
2019-04-15 05:31:07 +00:00
class Finger extends Controller {
2018-05-18 10:09:38 +00:00
function get() {
2019-04-15 05:31:07 +00:00
$o = replace_macros(get_markup_template('finger.tpl'), [
'$page_title' => t('Webfinger Diagnostic'),
'$resource' => [ 'resource', t('Lookup address or URL') , $_GET['resource'], EMPTY_STR ],
'$submit' => t('Submit')
]);
2018-05-18 10:09:38 +00:00
2019-04-15 05:31:07 +00:00
if($_GET['resource']) {
$resource = trim(escape_tags($_GET['resource']));
$result = Webfinger::exec($resource);
$o .= '<pre>' . str_replace("\n",'<br>',print_array($result)) . '</pre>';
2018-05-18 10:09:38 +00:00
}
return $o;
}
}