Semi-stable version with old variable names

This commit is contained in:
Fabio Herzig
2026-07-16 18:43:30 +02:00
parent 3731183654
commit c8e7ce9174
165 changed files with 25654 additions and 9728 deletions
+14 -5
View File
@@ -10,19 +10,28 @@ ini_wkvs_session();
verify_csrf();
check_multiple_allowed_permissions(['kampfrichter', 'wk_leitung']);
$accessPermission = trim($_POST['accessPermission'] ?? '');
$access = preg_replace("/[\W]/", "", trim($_POST['access'] ?? ''));
$accesstype = preg_replace("/[\W]/", "", trim($_POST['accesstype'] ?? ''));
if (!isset($_POST['access'])) {
if ($accessPermission === '' || $access === '' || $accesstype === '') {
echo json_encode(['success' => false, 'message' => 'Parameters not correctly set']);
http_response_code(400);
exit;
}
$access = preg_replace("/[\W]/", "", trim($_POST['access']));
require $baseDir . "/../scripts/websocket/ws-create-token.php";
$token = generateWSToken($access);
if ($accessPermission === "R") {
$token = generateWSReadToken($accesstype, $access);
} elseif ($accessPermission === "W") {
check_multiple_allowed_permissions(['kampfrichter', 'wk_leitung']);
$token = generateWSAdminToken($accesstype, $access);
} else {
http_response_code(403);
exit;
}
$responseBool = $token != null;