From 7fc566430f2ff5a5b5429c748beaee901c51f8e9 Mon Sep 17 00:00:00 2001 From: rsgrinko Date: Wed, 27 Apr 2022 19:17:35 +0300 Subject: [PATCH] =?UTF-8?q?[*]=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20=D1=84?= =?UTF-8?q?=D0=B8=D1=87=D0=B8=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/bootstrap.php | 1 + core/lib/Core/Models/User.class.php | 10 ++ index.php | 33 ++++--- phpcmd.php | 143 ++++++++++++++++++++++++++++ 4 files changed, 174 insertions(+), 13 deletions(-) create mode 100644 phpcmd.php diff --git a/core/bootstrap.php b/core/bootstrap.php index a86619f..c6beeb3 100644 --- a/core/bootstrap.php +++ b/core/bootstrap.php @@ -14,6 +14,7 @@ Template::set('CLEAR_CACHE_LINK_NAME', 'Сброс файлового кэша'); Template::set('ADMIN_PANEL_LINK_NAME', 'Панель администратора'); Template::set('REFRESH_PAGE_LINK_NAME', 'Перезагрузить страницу'); + Template::set('PHP_CMD_LINK_NAME', 'Командная PHP строка'); return Template::render($buffer); } catch(Throwable $e) { return $e->getMessage(); diff --git a/core/lib/Core/Models/User.class.php b/core/lib/Core/Models/User.class.php index 1b9b46f..3fea3c2 100644 --- a/core/lib/Core/Models/User.class.php +++ b/core/lib/Core/Models/User.class.php @@ -151,6 +151,16 @@ return $this->getAllUserData() ? $this->getAllUserData()['id'] : null; } + /** + * Получение прав доступа текущего пользователя + * + * @return string|null + */ + public function getAccessLevel(): ?string + { + return $this->getAllUserData() ? $this->getAllUserData()['access_level'] : null; + } + /** * Получение всех пользователей панели * diff --git a/index.php b/index.php index 408163a..bcf106e 100644 --- a/index.php +++ b/index.php @@ -36,6 +36,9 @@ +