/apps/myApp/profile.php?user=" * } * * but can also use complex database queries to generate the webfinger result **/ $userName = ''; $hostName = ''; $request = strip_tags(urldecode($_GET['q'])); if ($_GET['q']) { $reqParts = explode('@', $request); if (count($reqParts) == 2) { $userName = $reqParts[0]; $hostName = $reqParts[1]; } } if (substr($userName, 0, 5) == 'acct:') { $userName = substr($userName, 5); } if ($userName == "") { $id = ""; } else { $id = $userName . '@' . $hostName; } if (isset($_SERVER['HTTPS'])) { $baseAddress = 'https://'; } else { $baseAddress = 'http://'; } $baseAddress .= $_SERVER['SERVER_NAME'] . OC::$WEBROOT; if (empty($id)) { header("HTTP/1.0 400 Bad Request"); } define('WF_USER', $userName); define('WF_ID', $id); define('WF_BASEURL', $baseAddress); $appConfig = \OC::$server->getAppConfig(); $apps = $appConfig->getApps(); $links = array(); foreach ($apps as $app) { if (OCP\App::isEnabled($app)) { if (is_file(OC_App::getAppPath($app) . '/appinfo/webfinger.php')) { ob_start(); require $app . '/appinfo/webfinger.php'; $link = trim(ob_get_clean()); if ($link) { $links[] = $link; } } } } echo "{\"links\":["; echo implode(',', $links); echo "]}";