From 57503b2c6d4ce79bfbc088a32e64481aec6eb7b2 Mon Sep 17 00:00:00 2001 From: Bruno Eckhardt Date: Sun, 4 Jan 2026 20:16:51 +0100 Subject: [PATCH] fix: rename DebugLog function to ConsoleLog --- WEBROOT/index.php | 16 ++++----- WEBROOT/moduls/ConsoleLog.php | 2 +- WEBROOT/services/test.php | 65 +++++++++++++++++++++-------------- 3 files changed, 48 insertions(+), 35 deletions(-) diff --git a/WEBROOT/index.php b/WEBROOT/index.php index 39661d3..4cfe526 100644 --- a/WEBROOT/index.php +++ b/WEBROOT/index.php @@ -11,21 +11,21 @@ $cookie = new cookieController(); $clientIP = $data->getClientIP(); $whitelist = $data->getWhitelistedIPs(); -// if (in_array($clientIP, $whitelist)) { +if (in_array($clientIP, $whitelist)) { - // $cookie->SetCookie("USER", "1", 60); + $cookie->SetCookie("USER", "1", 60); print_r($data->ShowAllData()); echo 'Main Dashboard'; -// } else { +} else { -// $cookie->SetCookie("USER", "0", 60); + $cookie->SetCookie("USER", "0", 60); -// header("Location: /controller/RoutesController.php?website=/services/Dashboards/MainDashboard.php"); -// exit; -// } + header("Location: /controller/RoutesController.php?website=/services/Dashboards/MainDashboard.php"); + exit; +} $allData = (new getSpecificData())->getAllData(); -DebugLog($allData); +ConsoleLog($allData); logging(); \ No newline at end of file diff --git a/WEBROOT/moduls/ConsoleLog.php b/WEBROOT/moduls/ConsoleLog.php index 7ab6913..abeba65 100644 --- a/WEBROOT/moduls/ConsoleLog.php +++ b/WEBROOT/moduls/ConsoleLog.php @@ -1,6 +1,6 @@ "; foreach ($vars as $index => $value) { diff --git a/WEBROOT/services/test.php b/WEBROOT/services/test.php index 89a1e37..04ca329 100644 --- a/WEBROOT/services/test.php +++ b/WEBROOT/services/test.php @@ -1,34 +1,47 @@ getClientIP(); +$whitelist = $data->getWhitelistedIPs(); -DatabaseUpdate( - "Whitelisted", - "Grund = ?", - "id = ?", - "Localhost IP", // wert für Grund - 3 // wert für id -); +ConsoleLog($whitelist); -// DatabaseInsert( -// "Whitelisted", -// "`IP-ADDRESSE`, GRUND, STATUS", -// "80.153.174.251", -// "DEVELOPER", -// "true" -// ); +if (in_array($clientIP, $whitelist)) { + // DatabaseDelete( + // "Whitelisted", + // "id = ?", + // 5 // wert für spalte + // ); -$data = DatabaseShow( - "Whitelisted", - "id, `IP-ADDRESSE`, GRUND, STATUS" -); + // DatabaseUpdate( + // "Whitelisted", + // "Grund = ?", + // "id = ?", + // "Localhost IP", // wert für Grund + // 3 // wert für id + // ); -echo '
';
-print_r($data);
-echo '
'; \ No newline at end of file + // DatabaseInsert( + // "Whitelisted", + // "`IP-ADDRESSE`, GRUND, STATUS", + // "80.153.174.251", + // "DEVELOPER", + // "true" + // ); + + $data = DatabaseShow( + "Whitelisted", + "id, `IP-ADDRESSE`, GRUND, STATUS" + ); + + echo '
';
+    print_r($data);
+    echo '
'; +} else { + header("Location: /controller/RoutesController.php?website=/static/access_denied.php"); +} \ No newline at end of file