Überarbeitete Version der 1. Version. Es bestehen noch grosse Feher in einzelnen Skripten.

This commit is contained in:
Fabio Herzig
2026-04-18 23:45:17 +02:00
parent a51fd9dbeb
commit 3731183654
85 changed files with 2965 additions and 3371 deletions

View File

@@ -3,12 +3,15 @@
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
if (session_status() !== PHP_SESSION_ACTIVE) session_start();
$baseDir = $_SERVER['DOCUMENT_ROOT'];
$access_granted_wkl = $_SESSION['access_granted_wk_leitung'] ?? false;
require_once $baseDir . '/../scripts/session_functions.php';
ini_wkvs_session(true);
$csrf_token = $_SESSION['csrf_token'] ?? '';
$access_granted_wkl = check_user_permission('wk_leitung', true) ?? false;
?>
<!DOCTYPE html>
@@ -76,6 +79,7 @@ require $baseDir . '/intern/scripts/sidebar/sidebar.php';
let ws;
let firstConnect = true;
const RETRY_DELAY = 2000;
const csrf_token = "<?= $csrf_token ?>";
const urlAjaxNewWSToken = '/intern/scripts/ajax-create-ws-token.php';
@@ -86,7 +90,7 @@ require $baseDir . '/intern/scripts/sidebar/sidebar.php';
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: new URLSearchParams({ access: freigabe })
body: new URLSearchParams({ access: freigabe, csrf_token })
});
if (!response.ok) return null;
@@ -210,9 +214,17 @@ require $baseDir . '/intern/scripts/sidebar/sidebar.php';
});
function sendType(typeValue, $element, ctext) {
const url = `/intern/scripts/displaycontrol/ajax-update_display_config_json.php?type=${encodeURIComponent(typeValue)}&ctext=${encodeURIComponent(ctext)}`;
const url = `/intern/scripts/displaycontrol/ajax-update_display_config_json.php`;
fetch(url)
fetch(url,{
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
csrf_token,
type: typeValue,
ctext
})
})
.then(res => res.json())
.then(response => {