fix path for cybersecurity issues

fix path in admin.php & add to config.php mdp to connect to panel admin ( config.php is not commited )
This commit is contained in:
2026-05-18 00:37:51 +02:00
parent 30b858649a
commit 2d4f609562
2 changed files with 8 additions and 6 deletions
+7 -5
View File
@@ -2,9 +2,11 @@
/* --- SESSION & AUTHENTICATION --- */
session_start();
$config = require_once './config.php';
$error = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'login') {
if ($_POST['username'] === 'admin' && $_POST['password'] === 'admin') {
if ($_POST['username'] === $config['admin_user'] && $_POST['password'] === $config['admin_pass']) {
$_SESSION['admin_logged_in'] = true;
header('Location: admin.php');
exit;
@@ -20,10 +22,10 @@ if (isset($_GET['logout'])) {
}
/* --- DATABASE CONFIGURATION --- */
$host = 'mysql-openplanetsmaps.alwaysdata.net';
$dbname = 'openplanetsmaps_bdd';
$db_user = 'openplanetsmaps_root';
$db_pass = 'ka041006';
$host = $config['host'];
$dbname = $config['dbname'];
$db_user = $config['username'];
$db_pass = $config['password'];
$message = '';
/* --- FORM PROCESSING & DB INSERTION --- */