feat: just store handles, to simplify maintenance
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Darragh Elliott
2026-03-06 14:26:47 +00:00
parent 618bf23a5b
commit 8ff21c49c1
2 changed files with 9 additions and 6 deletions
+2 -2
View File
@@ -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">
+7 -4
View File
@@ -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;
}