Replace individual includes with include/all.php for consistent configuration and add cookie-based authentication in all.php.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ;
|
include $_SERVER['DOCUMENT_ROOT']."/include/all.php" ;
|
||||||
$pdo = DB_ZABBIX();
|
$pdo = DB_ZABBIX();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ;
|
include $_SERVER['DOCUMENT_ROOT']."/include/all.php" ;
|
||||||
$pdo = DB_ZABBIX();
|
$pdo = DB_ZABBIX();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ;
|
include $_SERVER['DOCUMENT_ROOT']."/include/all.php" ;
|
||||||
$pdo = DB_ZABBIX();
|
$pdo = DB_ZABBIX();
|
||||||
|
|
||||||
$server = strtoupper($_GET['c']);
|
$server = strtoupper($_GET['c']);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ;
|
include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php";
|
||||||
if (isset($_GET['term'])) {
|
if (isset($_GET['term'])) {
|
||||||
$term = $_GET['term'];
|
$term = $_GET['term'];
|
||||||
$query = "SELECT hostname AS serv FROM cmdb_srvall WHERE hostname LIKE '%$term%' UNION SELECT hostname AS serv FROM x_SRVALL WHERE hostname LIKE '%$term%'";
|
$query = "SELECT hostname AS serv FROM cmdb_srvall WHERE hostname LIKE '%$term%' UNION SELECT hostname AS serv FROM x_SRVALL WHERE hostname LIKE '%$term%'";
|
||||||
|
|||||||
@@ -24,8 +24,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-light text-dark">
|
<body class="bg-light text-dark">
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT']."/include/db_connect.php" ; ?> <!-- Database connexion -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-light text-dark">
|
<body class="bg-light text-dark">
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
|
|||||||
@@ -29,10 +29,9 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-light text-dark">
|
<body class="bg-light text-dark">
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/preloader.inc.html"; ?> <!-- Preloader -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/../../include/db_connect.php"; ?> <!-- Database connexion -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Database connexion -->
|
||||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
<div class="container-fluid">
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-light text-dark">
|
<body class="bg-light text-dark">
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/../../include/db_connect.php"; ?> <!-- Database connexion -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?>
|
||||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-light text-dark">
|
<body class="bg-light text-dark">
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-light text-dark">
|
<body class="bg-light text-dark">
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-light text-dark">
|
<body class="bg-light text-dark">
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-light text-dark">
|
<body class="bg-light text-dark">
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-light text-dark">
|
<body class="bg-light text-dark">
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
|
|||||||
@@ -26,8 +26,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-light text-dark">
|
<body class="bg-light text-dark">
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
|
|||||||
@@ -259,6 +259,28 @@
|
|||||||
return $pdo;
|
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'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- MODAL WAIT -->
|
<!-- MODAL WAIT -->
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="bg-light text-dark">
|
<body class="bg-light text-dark">
|
||||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
<?php include $_SERVER['DOCUMENT_ROOT']."/include/all.php" ; ?> <!-- Database connexion -->
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row flex-nowrap">
|
<div class="row flex-nowrap">
|
||||||
<!-- Left NAVBAR -->
|
<!-- Left NAVBAR -->
|
||||||
|
|||||||
Reference in New Issue
Block a user