From 7b183b6c32afc2ed4bd6488eb453972cc6a53117 Mon Sep 17 00:00:00 2001 From: rsgrinko Date: Thu, 2 Mar 2023 11:53:53 +0300 Subject: [PATCH] =?UTF-8?q?[+]=20=D0=B1=D0=B0=D0=B7=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D1=8F=20=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=BE=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D0=B0=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/cacheInfo.php | 6 ++ admin/groups.php | 6 ++ admin/hosts.php | 6 ++ admin/inc/header.php | 21 ++--- admin/nginx.php | 6 ++ admin/phpcmd.php | 4 + admin/threads.php | 6 ++ admin/users.php | 5 ++ core/api.php | 68 ++++++++++++++++ core/lib/Core/Api/ApiController.class.php | 76 ++++++++++++++++++ core/lib/Core/Api/ApiException.class.php | 34 ++++++++ core/lib/Core/Api/ApiView.class.php | 95 +++++++++++++++++++++++ core/lib/Core/Models/Roles.class.php | 5 ++ core/lib/Core/Models/User.class.php | 15 +++- 14 files changed, 342 insertions(+), 11 deletions(-) create mode 100644 core/api.php create mode 100644 core/lib/Core/Api/ApiController.class.php create mode 100644 core/lib/Core/Api/ApiException.class.php create mode 100644 core/lib/Core/Api/ApiView.class.php diff --git a/admin/cacheInfo.php b/admin/cacheInfo.php index ccddaa6..a7ae558 100644 --- a/admin/cacheInfo.php +++ b/admin/cacheInfo.php @@ -22,6 +22,12 @@ use Core\Helpers\{Cache, SystemFunctions}; require_once __DIR__ . '/inc/header.php'; + + global $USER; + if ($USER->isAdmin() === false) { + header('Location: ./'); + die(); + } ?>