]> git.mxchange.org Git - friendica.git/blobdiff - mod/webfinger.php
Bump DB version
[friendica.git] / mod / webfinger.php
index 74bd2c9543c6ceda125719b075f1fe08f7845c08..d823bd2dc217b988c8f5d41839ee22f77bfde8a8 100644 (file)
@@ -1,23 +1,26 @@
 <?php
+require_once("include/Probe.php");
 
+function webfinger_content(App $a) {
 
-
-function webfinger_content(&$a) {
+       if (!local_user()) {
+               http_status_exit(403,
+                               array("title" => t("Public access denied."),
+                                       "description" => t("Only logged in users are permitted to perform a probing.")));
+               killme();
+       }
 
        $o .= '<h3>Webfinger Diagnostic</h3>';
 
        $o .= '<form action="webfinger" method="get">';
        $o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />';
-       $o .= '<input type="submit" name="submit" value="Submit" /></form>'; 
+       $o .= '<input type="submit" name="submit" value="Submit" /></form>';
 
        $o .= '<br /><br />';
 
        if(x($_GET,'addr')) {
                $addr = trim($_GET['addr']);
-               if(strpos($addr,'@' !== false))
-                       $res = webfinger($addr);
-               else
-                       $res = lrdd($addr);
+               $res = Probe::lrdd($addr);
                $o .= '<pre>';
                $o .= str_replace("\n",'<br />',print_r($res,true));
                $o .= '</pre>';