From fc5617846d1164dc08705d0c7e0b4105b021b46a Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 29 Aug 2023 00:24:35 +0300 Subject: [PATCH] optionally auto-approve user on magnet approve --- src/public/edit.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/public/edit.php b/src/public/edit.php index e142c6e..888dfb0 100644 --- a/src/public/edit.php +++ b/src/public/edit.php @@ -172,12 +172,24 @@ else { // Update form if (!empty($_POST)) { - // Approve by moderation request - if ($user->approved || (isset($_POST['approved']) && in_array($user->address, MODERATOR_IP_LIST))) + // Approve by approved user + if ($user->approved) { $db->updateMagnetApproved($magnet->magnetId, true, time()); } + // Approve by moderation request + if (in_array($user->address, MODERATOR_IP_LIST)) + { + $db->updateMagnetApproved($magnet->magnetId, isset($_POST['approved']), time()); + + // Auto-approve user on magnet approve + if (USER_AUTO_APPROVE_ON_MAGNET_APPROVE) + { + $db->updateUserApproved($magnet->userId, isset($_POST['approved']), time()); + } + } + // Set default approve status else {