From e5be26187562fb867d2465d6518792481b45cf22 Mon Sep 17 00:00:00 2001 From: fds2610 Date: Mon, 19 Jan 2026 18:33:40 +0100 Subject: [PATCH] bug behoben Admin Funktion --- html/dashboard.php | 2 -- html/rep-month.php | 5 +++++ html/rep-person.php | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/html/dashboard.php b/html/dashboard.php index c4e406a..5c0ddfe 100644 --- a/html/dashboard.php +++ b/html/dashboard.php @@ -9,8 +9,6 @@ if (!isset($_SESSION['user_id'])) { // Ab hier: Nur für angemeldete Benutzer error_log($_SESSION['user_id']); -// Standard: kein Admin -$is_admin = "false"; // Prüfen, ob die user_id im Admin-Array ist if (in_array($_SESSION['user_id'], $admin_ids, true)) { diff --git a/html/rep-month.php b/html/rep-month.php index 4227c64..4f982eb 100644 --- a/html/rep-month.php +++ b/html/rep-month.php @@ -5,6 +5,11 @@ if (!isset($_SESSION['user_id'])) { exit; } +// Prüfen, ob die user_id im Admin-Array ist +if (in_array($_SESSION['user_id'], $admin_ids, true)) { + $is_admin = "true"; +} + // Aktuelles Jahr und Monat ermitteln, ggf. aus GET-Parametern $year = isset($_GET['year']) ? (int)$_GET['year'] : (int)date('Y'); $month = isset($_GET['month']) ? (int)$_GET['month'] : (int)date('m'); diff --git a/html/rep-person.php b/html/rep-person.php index e76f767..77c5d5d 100644 --- a/html/rep-person.php +++ b/html/rep-person.php @@ -5,6 +5,11 @@ if (!isset($_SESSION['user_id'])) { exit; } +// Prüfen, ob die user_id im Admin-Array ist +if (in_array($_SESSION['user_id'], $admin_ids, true)) { + $is_admin = "true"; +} + // Aktuelles Jahr und Monat ermitteln, ggf. aus GET-Parametern $year = isset($_GET['year']) ? (int)$_GET['year'] : (int)date('Y'); $month = isset($_GET['month']) ? (int)$_GET['month'] : (int)date('m');