From 1c87ba31a7fa892c49f8a2436386693febeb23b7 Mon Sep 17 00:00:00 2001
From: Floorb <132411956+Neetpone@users.noreply.github.com>
Date: Mon, 12 Jul 2021 22:21:19 -0400
Subject: [PATCH] Untested additions to admin configuration, just pushing what
I have before bed.
---
admin/configuration.php | 115 +++++++++++++++-------------------------
config/site.php | 13 +++++
2 files changed, 57 insertions(+), 71 deletions(-)
diff --git a/admin/configuration.php b/admin/configuration.php
index 35768aa..81243e4 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -6,7 +6,7 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -34,8 +34,9 @@ function updateConfiguration(string $path, array $new_config) {
/** @noinspection PhpIncludeInspection */
$current_config = require(CONFIG_FILE_PATH);
$current_site_info = $current_config['site_info'];
+$current_permissions = $current_config['permissions'];
+$current_mail = $current_config['mail'];
-$query = "SELECT * FROM captcha WHERE id = '1'";
$result = $conn->query('SELECT * FROM captcha WHERE id = 1');
if ($row = $result->fetch()) {
@@ -48,13 +49,6 @@ if ($row = $result->fetch()) {
$recaptcha_secretkey = $row['recaptcha_secretkey'];
}
-$result = $conn->query("SELECT * FROM site_permissions WHERE id='1'");
-
-if ($row = $result->fetch()) {
- $disableguest = Trim($row['disableguest']);
- $siteprivate = Trim($row['siteprivate']);
-}
-
$result = $conn->query("SELECT * FROM mail WHERE id='1'");
if ($row = $result->fetch()) {
@@ -88,31 +82,43 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$current_config['site_info'] = $new_site_info;
$current_site_info = $new_site_info;
- updateConfiguration(CONFIG_FILE_PATH, $current_config);
- $msg = '