OpenWebAuth path is now fetched during probing

This commit is contained in:
Michael 2024-05-20 19:36:40 +00:00
parent ea5e1f1edc
commit da37516abf
13 changed files with 143 additions and 52 deletions

View file

@ -2484,6 +2484,25 @@ class GServer
DI::keyValue()->set('poco_last_federation_discovery', time());
}
public static function updateFromProbeArray(array $data)
{
if (empty($data['gsid']) || empty($data['openwebauth'])) {
return;
}
$gserver = DBA::selectFirst('gserver', ['openwebauth'], ['id' => $data['gsid']]);
if (!DBA::isResult($gserver)) {
return;
}
if ($data['openwebauth'] == $gserver['openwebauth']) {
return;
}
Logger::debug('Set Open Web Auth path', ['baseurl' => $data['baseurl'], 'openwebauth' => $data['openwebauth']]);
self::update(['openwebauth' => $data['openwebauth']], ['id' => $data['gsid']]);
}
/**
* Set the protocol for the given server
*