From patchwork Fri Jul 3 19:02:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Morris X-Patchwork-Id: 1704 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 3A50319B70AD4 for ; Fri, 3 Jul 2020 19:02:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_ADSP_CUSTOM_MED=0.001, DKIM_INVALID=1,DKIM_SIGNED=0.1,FREEMAIL_FROM=0.5,MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,RCVD_IN_MSPIKE_H4=0.001,RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,T_DMARC_POLICY_NONE=0.01,T_DMARC_SIMPLE_DKIM=0.01, WEIRD_QUOTING=0.001 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-BL-Results: [127.0.0.19] [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Fri, 3 Jul 2020 19:02:47 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 613471D357F3B0; Fri, 3 Jul 2020 19:02:36 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [5.9.250.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 3EEB31D357F3AB; Fri, 3 Jul 2020 19:02:36 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IKURq8/D Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 29BB829CBA; Fri, 3 Jul 2020 19:02:36 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IKURq8/D Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id B481129CB9 for ; Fri, 3 Jul 2020 19:02:32 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Fri, 3 Jul 2020 19:02:32 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 2A1E41D357F3A9 for ; Fri, 3 Jul 2020 19:02:27 +0000 (UTC) Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Fri, 3 Jul 2020 19:02:27 +0000 (UTC) Received: by mail-pj1-x1031.google.com with SMTP id cm21so4871411pjb.3 for ; Fri, 03 Jul 2020 12:02:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uU8t7JOEXGStOB8JpRx1ToCPZHn/lMR2MP6K2uzCJV4=; b=IKURq8/D/TjE0Qwv8ckwJaD7Q0AwY6xtX5kUS5MZ9ReYjHvbfnHxsx8P/xG+aSN/1S Ju2PYITe1S4mRfLmt3iCfiAARDwGO6iSzwFRxKd17dmbEI4IMS30GTDaQ2z5GKJ5Q381 DKRGhtv84B+PgVgBVUrg8OcScxVE4BgBYKCQ4+TOObH1gmY7G2FYQ/rOuwigwJrBQv+A 7bNNY5EujjUAJ3wVBm+u3kAAwTuTdmnutkphXVO9Tp1yTB0hEN8MtGTlfk4EesMLr/ie ldFVtU0RLim9PR2BUahDnfWyjG0HfckmJa3AHNJAirwwY71Qs5b6CT0xF2CJulAiWMz9 fTaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uU8t7JOEXGStOB8JpRx1ToCPZHn/lMR2MP6K2uzCJV4=; b=lP3v7OfI5ipcypABsOkwE44qyQ//CoURQpngX0f5lpaccrRpEWoB30wz0efjY3P4BQ J90SnzajsE+K4Sgkanot9pf9oaUYl5GQeQaJRrVgAWZ1NWhAAXx1H1rZD3OVwFN43iIy UG1xwI5jPEVItQtAGeoac7tE7ImruxTH8W4mmxMlTFHRe3p7OdFM9qH+93KwcjXA2o9D VmPRQoCj3daMDQQGOKfWAPJ+50tnigu3rVTTohy1zD6CrbCQrpwET/lRw2ZStXxK+c2g 666GB6Kvb1KTKflEpUSGT0YBXQn6QadiRLRxyPqOfrdlGvB8/aGTUWWfYlmkhZWwJn6E 961w== X-Gm-Message-State: AOAM531DkVWhoOi0thlwwTGAEbc3hVOssmyrXhxm7BiMcaxgy1saEDnY QgVOHsC6JynC63eHuigWtE/5G4+6uWo= X-Google-Smtp-Source: ABdhPJwXwI6CrKXznzb19oDHZui45k4416voiCOOKsE8GkP4GI5nAYFqeUkolvFP+Si/2sEOYT+xfA== X-Received: by 2002:a17:90a:c68e:: with SMTP id n14mr37946938pjt.182.1593802943956; Fri, 03 Jul 2020 12:02:23 -0700 (PDT) Received: from localhost.localdomain ([2600:1:9a26:fe89:ada4:f7e5:6495:8234]) by smtp.gmail.com with ESMTPSA id d18sm11497507pjz.11.2020.07.03.12.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2020 12:02:23 -0700 (PDT) From: Kevin Morris To: aur-dev@archlinux.org Subject: [PATCH] Remove PackageNotifications when User is suspended Date: Fri, 3 Jul 2020 12:02:11 -0700 Message-Id: <20200703190211.11979-1-kevr.gtalk@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: aur-dev@archlinux.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Arch User Repository \(AUR\) Development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: aur-dev-bounces@archlinux.org Sender: "aur-dev" This path will only trigger when suspending a user through an account page; if the database is managed manually or through another script, PackageNotifications will also need manual modifications if intended. This change was written as a solution to https://bugs.archlinux.org/task/65554. Signed-off-by: Kevin Morris --- web/lib/acctfuncs.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index d238c0e0..fb7cca8c 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -403,6 +403,10 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$BE="",$H="",$P=" $q.= " WHERE ID = ".intval($UID); $result = $dbh->exec($q); + // Clean up PackageNotifications for $UID as well. + $q = "DELETE FROM PackageNotifications WHERE UserID = ".intval($UID); + $result = $dbh->exec($q); + if (isset($ssh_keys) && count($ssh_keys) > 0) { $ssh_key_result = account_set_ssh_keys($UID, $ssh_keys, $ssh_fingerprints); } else {