fix admin

This commit is contained in:
themohooks 2024-07-21 17:53:09 +03:00
parent f5d26107b8
commit 87c7fa537b
2 changed files with 2 additions and 3 deletions

View file

@ -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,

View file

@ -22,7 +22,6 @@ use \App\Models\User;
<h1><?= $_GLOBAL['title'] ?></h1>
<div class="p20" style="padding:20px">
<?php
$myfile = fopen($_SERVER['DOCUMENT_ROOT'].$_GLOBAL['rules'], "r") or die("Unable to open file!");
echo fread($myfile,filesize($_SERVER['DOCUMENT_ROOT'].$_GLOBAL['rules']));