feat: just store handles, to simplify maintenance
This commit is contained in:
@@ -324,7 +324,7 @@
|
||||
<function volunteers="web">coordinator/m</function>
|
||||
<link>/about/people/tobiasd/tobiasd.html</link>
|
||||
<avatar>tobiasd.png</avatar>
|
||||
<fediverse location="https://social.diekershoff.de/xrd?uri=acct:tobias@social.diekershoff.de">tobiasd@fsfe.org</fediverse>
|
||||
<fediverse handle="tobias@social.diekershoff.de">tobiasd@fsfe.org</fediverse>
|
||||
</person>
|
||||
|
||||
<person id="dietrich">
|
||||
@@ -629,7 +629,7 @@
|
||||
<link>/about/people/kirschner/kirschner.html</link>
|
||||
<avatar>kirschner.jpg</avatar>
|
||||
<employee>full/m</employee>
|
||||
<fediverse location="https://mastodon.social/.well-known/webfinger?resource=acct:kirschner@mastodon.social">mk@fsfe.org</fediverse>
|
||||
<fediverse handle="kirschner@mastodon.social">mk@fsfe.org</fediverse>
|
||||
</person>
|
||||
|
||||
<person id="kneissl">
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
$acc_request = strtolower($_GET['resource'] ?? '');
|
||||
$xml_file = $_SERVER['DOCUMENT_ROOT'].'about/people/people.en.xml';
|
||||
$people = simplexml_load_file($xml_file);
|
||||
|
||||
if (false === $people) {
|
||||
http_response_code(500);
|
||||
echo 'ERROR: Could not load people file. Please check the path:'.$xml_file;
|
||||
@@ -12,10 +11,14 @@ if (false === $people) {
|
||||
}
|
||||
|
||||
foreach ($people->xpath('//fediverse') as $fedi_elem) {
|
||||
if ('acct:'.strval($fedi_elem) == $acc_request) {
|
||||
if ('acct:'.strval($fedi_elem) === $acc_request) {
|
||||
// if we have a location, return it and exit
|
||||
if (isset($fedi_elem['location'])) {
|
||||
header('Location: '.strval($fedi_elem['location']));
|
||||
if (isset($fedi_elem['handle'])) {
|
||||
// Handles are in the form <username>@<server>
|
||||
$handle = strval($fedi_elem['handle']);
|
||||
$handle_sections = explode('@', $handle);
|
||||
$response = 'Location: https://'.$handle_sections[1].'/.well-known/webfinger?resource=acct:'.$handle;
|
||||
header($response);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user