phpstan level 0 error free - fixes for kyu subpage - move mams into participo framework - remove legacy `lib/db.php` usage - add attributer admin function - add newsposter - fixing apiKey creation
38 lines
1021 B
PHP
38 lines
1021 B
PHP
<?php
|
|
require_once "bootstrap.php";
|
|
|
|
require_once "participoLib/apiKey.php";
|
|
|
|
function get()
|
|
{
|
|
$wkSqlQuery =
|
|
"SELECT DISTINCT" .
|
|
" `wkParticipo_Users`.* " .
|
|
" FROM `wkParticipo_Users`" .
|
|
" JOIN `wkParticipo_user<=>userAttributes`" .
|
|
" ON `wkParticipo_user<=>userAttributes`.`userId` = `wkParticipo_Users`.`id`" .
|
|
" WHERE `wkParticipo_user<=>userAttributes`.`attributeId` = 4" .
|
|
" ORDER BY `wkParticipo_Users`.`id` ASC;";
|
|
|
|
$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);
|
|
}
|
|
}
|
|
return $wkSqlResponse;
|
|
}
|
|
|
|
authorize();
|
|
$wkSqlResponse = get();
|
|
|
|
// Sending Response
|
|
// - setting header
|
|
header("Content-Type: application/json");
|
|
// - sending body payload
|
|
echo json_encode($wkSqlResponse);
|