Content Security Policy (CSP) compatibility beta.

This commit is contained in:
2026-06-20 00:21:19 +02:00
parent 0b76255cfa
commit 8b742d997c
68 changed files with 1632 additions and 1421 deletions

View File

@@ -33,12 +33,41 @@ class API_office_stompjes extends API
$this->apiOutput(200, ['success' => 'Stomp removed.']);
}
public function getStomp()
public function getStomp($frontend = false)
{
list($query, $types, $params) = $this->buildDynamicQuery('office_stompjes');
if (!$frontend) {
list($query, $types, $params) = $this->buildDynamicQuery('office_stompjes');
$items = $this->generalGetFunction($query, $types, $params, false, 'Stompjes');
$items = $this->generalGetFunction($query, $types, $params, false, 'Stompjes');
return ($items);
return ($items);
} else {
if (!isset($_GET['fd'])) {
$SelectFromDate = strtotime(date('Y-m-01'));
} else {
$date = str_replace('/', '-', htmlspecialchars($_GET['fd'], ENT_QUOTES, 'UTF-8'));
$SelectFromDate = strtotime($date . ' 00:00:00');
}
if (!isset($_GET['td'])) {
$SelectTillDate = time();
} else {
$date = str_replace('/', '-', htmlspecialchars($_GET['td'], ENT_QUOTES, 'UTF-8'));
$SelectTillDate = strtotime($date . ' 23:59:59');
}
$stompjes = [];
$stmt = $this->conn->query("SELECT stomp_uuid, office_stompjes.user_uuid, user_full_name, user_first_name, stomp_timestamp
FROM office_stompjes
INNER JOIN system_users ON office_stompjes.user_uuid = system_users.user_uuid
WHERE stomp_timestamp BETWEEN '$SelectFromDate' AND '$SelectTillDate'
AND user_stompable = '1'
ORDER BY stomp_timestamp DESC");
while ($row = $stmt->fetch_assoc()) {
$stompjes[] = $row;
}
return $stompjes;
}
}
}