From 87c7fa537be0887b8172624cac6e55e8e54d9fa3 Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Sun, 21 Jul 2024 17:53:09 +0300 Subject: [PATCH] fix admin --- views/pages/Admin/UserEdit.php | 4 ++-- views/pages/Rules.php | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/views/pages/Admin/UserEdit.php b/views/pages/Admin/UserEdit.php index 3dfa29f..4b2740b 100644 --- a/views/pages/Admin/UserEdit.php +++ b/views/pages/Admin/UserEdit.php @@ -25,7 +25,7 @@ if (isset($_POST['subbtn'])) { $updatedJson = updateJson($currentJson, 'premoderation', $premoderation); $updatedJsonString = json_encode($updatedJson, JSON_PRETTY_PRINT); - if ($admin === 1 && Auth::userid() === 1) { + if (($admin === 1 && Auth::userid() === 1) || ($admin != 1 && Auth::userid() != 1)) { DB::query("UPDATE users SET status = ?, admin = ?, content = ? WHERE id = ?", [ $accountstatus, $admin, @@ -33,7 +33,7 @@ if (isset($_POST['subbtn'])) { $userId ]); echo "Данные успешно обновлены."; - } else { + } else { echo 'Не удалось обновить данные'; } diff --git a/views/pages/Rules.php b/views/pages/Rules.php index 8b17762..6d01ec4 100644 --- a/views/pages/Rules.php +++ b/views/pages/Rules.php @@ -22,7 +22,6 @@ use \App\Models\User;

-