From dcfe098f35daf2f184583702e8d66c3f0b90362f Mon Sep 17 00:00:00 2001 From: sva-e025532 Date: Thu, 25 Sep 2025 14:10:01 +0200 Subject: [PATCH] Replace individual includes with `include/all.php` for consistent configuration and add cookie-based authentication in `all.php`. --- Inventory/Z_data_aix.php | 2 +- Inventory/Z_data_linux.php | 2 +- Inventory/Z_data_windows.php | 2 +- Inventory/search_servers.php | 2 +- Links/Links.php | 3 +-- crossover/Detail.php | 2 +- crossover/Detail2.php | 2 +- crossover/GlobalCrossover.php | 7 +++---- dashboard/AD-Detail.php | 3 +-- dashboard/EPO-Detail.php | 2 +- dashboard/GLPI-Detail.php | 2 +- dashboard/NBU-Detail.php | 3 +-- dashboard/Nessus-Detail.php | 2 +- dashboard/S1-Detail.php | 2 +- dashboard/SCCM-Detail.php | 3 +-- include/all.php | 22 ++++++++++++++++++++++ index.php | 2 +- 17 files changed, 40 insertions(+), 23 deletions(-) diff --git a/Inventory/Z_data_aix.php b/Inventory/Z_data_aix.php index 1fa0814..ba0cb5d 100644 --- a/Inventory/Z_data_aix.php +++ b/Inventory/Z_data_aix.php @@ -1,5 +1,5 @@ - - +
diff --git a/crossover/Detail.php b/crossover/Detail.php index b6e3ae3..5be30f1 100644 --- a/crossover/Detail.php +++ b/crossover/Detail.php @@ -27,7 +27,7 @@ - +
diff --git a/crossover/Detail2.php b/crossover/Detail2.php index 921a812..3be63dc 100644 --- a/crossover/Detail2.php +++ b/crossover/Detail2.php @@ -27,7 +27,7 @@ - +
diff --git a/crossover/GlobalCrossover.php b/crossover/GlobalCrossover.php index e6a3ca8..ace6efe 100644 --- a/crossover/GlobalCrossover.php +++ b/crossover/GlobalCrossover.php @@ -29,10 +29,9 @@ - - - -
+ + +
diff --git a/dashboard/AD-Detail.php b/dashboard/AD-Detail.php index 86a7cb1..310f380 100644 --- a/dashboard/AD-Detail.php +++ b/dashboard/AD-Detail.php @@ -26,8 +26,7 @@ - - +
diff --git a/dashboard/EPO-Detail.php b/dashboard/EPO-Detail.php index 7e6b77b..50cffb8 100644 --- a/dashboard/EPO-Detail.php +++ b/dashboard/EPO-Detail.php @@ -26,7 +26,7 @@ - +
diff --git a/dashboard/GLPI-Detail.php b/dashboard/GLPI-Detail.php index 72780de..64cc66f 100644 --- a/dashboard/GLPI-Detail.php +++ b/dashboard/GLPI-Detail.php @@ -26,7 +26,7 @@ - +
diff --git a/dashboard/NBU-Detail.php b/dashboard/NBU-Detail.php index 61ea923..04e8611 100644 --- a/dashboard/NBU-Detail.php +++ b/dashboard/NBU-Detail.php @@ -26,8 +26,7 @@ - - +
diff --git a/dashboard/Nessus-Detail.php b/dashboard/Nessus-Detail.php index 7e6b77b..50cffb8 100644 --- a/dashboard/Nessus-Detail.php +++ b/dashboard/Nessus-Detail.php @@ -26,7 +26,7 @@ - +
diff --git a/dashboard/S1-Detail.php b/dashboard/S1-Detail.php index d945bf6..b6da99e 100644 --- a/dashboard/S1-Detail.php +++ b/dashboard/S1-Detail.php @@ -26,7 +26,7 @@ - +
diff --git a/dashboard/SCCM-Detail.php b/dashboard/SCCM-Detail.php index 9c41d30..c6d0248 100644 --- a/dashboard/SCCM-Detail.php +++ b/dashboard/SCCM-Detail.php @@ -26,8 +26,7 @@ - - +
diff --git a/include/all.php b/include/all.php index 7b50df8..151587f 100644 --- a/include/all.php +++ b/include/all.php @@ -259,6 +259,28 @@ return $pdo; } + + + //Set Cookies + $secretKey = 'impossibleatrouvercommeca'; + $remoteUser = $_SERVER['REMOTE_USER'] ?? null; + if ($remoteUser) { + $expiration = time() + 3600; // Token is valid for 1 hour + $payload = base64_encode($remoteUser . '|' . $expiration); // Combine user and expiration + $signature = hash_hmac('sha256', $payload, $secretKey); + $cookieValue = $payload . '.' . $signature; + + // Set the cookie + setcookie('AuthToken', $cookieValue, [ + 'expires' => time() + 3600, + 'path' => '/', + 'domain' => '.appliarmony.net', + 'secure' => false, // true quand HTTPS + 'httponly' => true, + 'samesite' => 'Lax' + ]); + } + ?> diff --git a/index.php b/index.php index 83c396f..3d209c2 100644 --- a/index.php +++ b/index.php @@ -25,7 +25,7 @@ - +