From 7b6ea55d8d83910aad7f57adbfc77f8bbde61a3d Mon Sep 17 00:00:00 2001 From: Walter Hupfeld Date: Tue, 12 Mar 2024 17:40:20 +0100 Subject: [PATCH] admin improvements --- admin/alter_table.php | 9 +-------- admin/configuration.php | 27 +++++++++------------------ admin/export.php | 14 +++++++------- admin/geocoding.php | 12 ++++++------ admin/index.php | 17 ++++++----------- admin/password.php | 16 ++++++++++++---- ajax/ajax_update.php | 5 ++--- lib/dialog_edit_location.php | 1 - 8 files changed, 43 insertions(+), 58 deletions(-) diff --git a/admin/alter_table.php b/admin/alter_table.php index 253bdad..919fb99 100644 --- a/admin/alter_table.php +++ b/admin/alter_table.php @@ -21,11 +21,4 @@ $db->exec("CREATE TABLE IF NOT EXISTS user( created_at TEXT DEFAULT CURRENT_TIMESTAMP )"); -header("Location: configuration.php"); - - - -INSERT INTO user (username, passwordhash, district) -SELECT district, "$2y$10$W9CE8IOOfnfi3XTMEVByZeDIrZo1VPxCHz2CfCe.sOH87V/AdaUG2", district -FROM district; - +header("Location: configuration.php"); \ No newline at end of file diff --git a/admin/configuration.php b/admin/configuration.php index ecdf3e1..783b4d0 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -5,14 +5,12 @@ if (!$boolLogin) { header("Location: login.php"); } - if (isset($_SESSION['superadmin'])) { - $boolSuperAdmin = $_SESSION['superadmin']==true; - } else { - $boolSuperAdmin=false; + $boolSuperAdmin = (bool)$_SESSION['superadmin']; } - - + // Für lokale Administration keine Konfiguration + if (!$boolSuperAdmin) { header("Location: index.php"); } + $strDistrict = $_SESSION['district']; require_once("../config.php"); $boolError=false; ?> @@ -27,10 +25,9 @@ Konfigruation @@ -59,7 +56,6 @@ Passwort ändern -
-
-