summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
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
);