summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-02-07 15:03:59 +0100
committerdklawren <dklawren@users.noreply.github.com>2018-02-07 15:03:59 +0100
commitc20774f3a3602a05596c7eea12edd6882097b4e4 (patch)
tree4b88401082a445b108147c23dc05e95f896ad9b6 /scripts
parenta04c1a35649b19f80e1c56cf907691daa7705abc (diff)
downloadbugzilla-c20774f3a3602a05596c7eea12edd6882097b4e4.tar.gz
bugzilla-c20774f3a3602a05596c7eea12edd6882097b4e4.tar.xz
Bug 1436301 - Exempt bot accounts from idle group removal
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/remove_idle_group_members.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/remove_idle_group_members.pl b/scripts/remove_idle_group_members.pl
index 407a8e6dc..74e8658ff 100755
--- a/scripts/remove_idle_group_members.pl
+++ b/scripts/remove_idle_group_members.pl
@@ -31,16 +31,20 @@ my $dbh = Bugzilla->dbh;
# Record any changes as made by the automation user
my $auto_user = Bugzilla::User->check({ name => 'automation@bmo.tld' });
+# This ignores things that end with "bugs" or ".tld", just like
+# Bugzilla/BugMail.pm sub Send()
my $expired = $dbh->selectall_arrayref(
- "SELECT DISTINCT profiles.userid AS user_id,
+ q{SELECT DISTINCT profiles.userid AS user_id,
groups.id AS group_id
FROM profiles JOIN user_group_map ON profiles.userid = user_group_map.user_id
JOIN groups ON user_group_map.group_id = groups.id
WHERE user_group_map.grant_type = ?
+ AND profiles.login_name NOT LIKE '%bugs'
+ AND profiles.login_name NOT LIKE '%.tld'
AND groups.idle_member_removal > 0
AND (profiles.last_seen_date IS NULL
OR TO_DAYS(LOCALTIMESTAMP(0)) - TO_DAYS(profiles.last_seen_date) > groups.idle_member_removal)
- ORDER BY profiles.login_name",
+ ORDER BY profiles.login_name},
{ Slice => {} }, GRANT_DIRECT
);