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;