From 0fbd198610bb2ff85258b4b9b966a76798ccfc59 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Thu, 25 Aug 2022 17:10:03 +0800 Subject: [PATCH] fix: torrent edit visible = no when no torrentmanage privilege --- public/takeedit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/takeedit.php b/public/takeedit.php index 2d72ba7d..5278e0f4 100644 --- a/public/takeedit.php +++ b/public/takeedit.php @@ -106,7 +106,9 @@ $updateset[] = "standard = " . sqlesc(intval($_POST["standard_sel"] ?? 0)); $updateset[] = "processing = " . sqlesc(intval($_POST["processing_sel"] ?? 0)); $updateset[] = "team = " . sqlesc(intval($_POST["team_sel"] ?? 0)); $updateset[] = "audiocodec = " . sqlesc(intval($_POST["audiocodec_sel"] ?? 0)); -$updateset[] = "visible = '" . (isset($_POST["visible"]) && $_POST["visible"] ? "yes" : "no") . "'"; +if (user_can('torrentmanage')) { + $updateset[] = "visible = '" . (isset($_POST["visible"]) && $_POST["visible"] ? "yes" : "no") . "'"; +} if(user_can('torrentonpromotion')) { if(!isset($_POST["sel_spstate"]) || $_POST["sel_spstate"] == 1)