mirror of
https://github.com/WerySkok/nativegallery.git
synced 2024-12-22 08:30:59 +03:00
fix admin
This commit is contained in:
parent
f5d26107b8
commit
87c7fa537b
2 changed files with 2 additions and 3 deletions
|
@ -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 'Не удалось обновить данные';
|
||||
}
|
||||
|
||||
|
|
|
@ -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']));
|
||||
|
|
Loading…
Reference in a new issue