wip: rest api user endpoint

This commit is contained in:
marko
2023-12-24 19:46:49 +01:00
parent 9ab62485a6
commit 38cc02120c
4 changed files with 60 additions and 28 deletions

View File

@@ -39,15 +39,23 @@ $wkSqlQuery = "SELECT DISTINCT"
$wkSqlResponse = dbConnector::query($wkSqlQuery);
// Postprocessing
// - convert the comma separated list into an array
foreach( $wkSqlResponse as &$user){
$user['eMail'] = explode(",", $user['eMail']);
foreach( $user['eMail'] as &$email){
$email = trim($email);
}
}
header('Access-Control-Allow-Headers: *');
header('Access-Control-Allow-Origin: *');
// Sending Response
// - setting header
header('Content-Type: application/json');
// - sending body payload
echo(
json_encode($wkSqlResponse)
// json_encode(getallheaders())
// json_encode($_SERVER)
);
// @todo Should not be necessary. But until the problem with the timeout time of the requesting client is solved, this explicit exit() stands!
exit(0);
?>