[PATCH] Remove PackageNotifications when User is suspended
Kevin Morris
kevr.gtalk at gmail.com
Sat Jul 4 00:06:56 UTC 2020
Updated patch inc which only modifies `scripts/notify.py` and preserves
notification records.
On Fri, Jul 3, 2020 at 12:02 PM Kevin Morris <kevr.gtalk at gmail.com> wrote:
> 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 <kevr.gtalk at gmail.com>
> ---
> 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 {
> --
> 2.20.1
>
>
--
Kevin Morris
Software Developer
Personal Inquiries: kevr.gtalk at gmail.com
Personal Phone: (415) 583-9687
Technologies: C, C++, Python, Django, Ruby, Rails, ReactJS, jQuery,
Javascript, SQL, Redux
More information about the aur-dev
mailing list