From 457c946946b7495a7de6bddbc591d1672905c610 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Sun, 27 Apr 2025 15:48:07 +0300 Subject: [PATCH] Adds some user right restrictions --- app/pages/config.php | 3 ++- app/templates/config.php | 3 ++- app/templates/page-menu.php | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/pages/config.php b/app/pages/config.php index 48c80be..e944722 100644 --- a/app/pages/config.php +++ b/app/pages/config.php @@ -114,7 +114,8 @@ if (!$isAjax) { * Handles GET requests to display templates. */ - if ($userObject->hasRight($userId, 'view config file')) { + if ($userObject->hasRight($userId, 'superuser') || + $userObject->hasRight($userId, 'view config file')) { include '../app/templates/config.php'; } else { $logObject->insertLog($userId, "Unauthorized: User \"$currentUser\" tried to access \"config\" page. IP: $user_IP", 'system'); diff --git a/app/templates/config.php b/app/templates/config.php index eda1801..cb6180a 100644 --- a/app/templates/config.php +++ b/app/templates/config.php @@ -17,7 +17,8 @@ app configuration -hasRight($userId, 'edit config file')) { ?> +hasRight($userId, 'superuser') || + $userObject->hasRight($userId, 'edit config file')) { ?>