clients: Move /clients to sync.elwig.at
This commit is contained in:
@ -19,15 +19,3 @@ function authenticate(): void {
|
||||
http_401_unauthorized();
|
||||
}
|
||||
}
|
||||
|
||||
function authenticate_client(string $client): void {
|
||||
global $CLIENT_CREDENTIALS;
|
||||
$credentials = $CLIENT_CREDENTIALS[$client];
|
||||
if (!array_key_exists('PHP_AUTH_USER', $_SERVER) ||
|
||||
!array_key_exists('PHP_AUTH_PW', $_SERVER) ||
|
||||
!array_key_exists($_SERVER['PHP_AUTH_USER'], $credentials) ||
|
||||
$_SERVER['PHP_AUTH_PW'] !== $credentials[$_SERVER['PHP_AUTH_USER']])
|
||||
{
|
||||
http_401_unauthorized();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user