Filter out current username from co-maintainers list.

Message ID 20210407090724.68221-1-artafinde@gmail.com
State New
Headers show
Series Filter out current username from co-maintainers list. | expand

Commit Message

Leonidas Spyropoulos April 7, 2021, 9:07 a.m. UTC
Closes: #8
Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com>
---
 web/html/pkgbase.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

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']);