From artafinde at gmail.com Wed Apr 7 09:07:24 2021 From: artafinde at gmail.com (Leonidas Spyropoulos) Date: Wed, 7 Apr 2021 10:07:24 +0100 Subject: [PATCH] Filter out current username from co-maintainers list. Message-ID: <20210407090724.68221-1-artafinde@gmail.com> Closes: #8 Signed-off-by: Leonidas Spyropoulos --- web/html/pkgbase.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/html/pkgbase.php b/web/html/pkgbase.php index b716644c..e99ea0c8 100644 --- a/web/html/pkgbase.php +++ b/web/html/pkgbase.php @@ -116,7 +116,8 @@ if (check_token()) { } elseif (current_action("do_CloseRequest")) { list($ret, $output) = pkgreq_close($_POST['reqid'], $_POST['reason'], $_POST['comments']); } elseif (current_action("do_EditComaintainers")) { - list($ret, $output) = pkgbase_set_comaintainers($base_id, explode("\n", $_POST['users'])); + list($ret, $output) = pkgbase_set_comaintainers($base_id, array_diff(array_map('trim', explode("\n", $_POST['users'])), + array(username_from_id(uid_from_sid($_COOKIE["AURSID"]))))); } elseif (current_action("do_AddComment")) { $uid = uid_from_sid($_COOKIE["AURSID"]); list($ret, $output) = pkgbase_add_comment($base_id, $uid, $_REQUEST['comment']); -- 2.31.1