summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorjustdave%bugzilla.org <>2008-03-11 21:50:04 +0100
committerjustdave%bugzilla.org <>2008-03-11 21:50:04 +0100
commit7c6954f9189af00752c59112b79c79d8bef49390 (patch)
tree0764dcf75577bb63d3820f7f2dfff989612db4a6 /contrib
parent5f77ed27305d20ec9c28e637d6194ed3e87efd02 (diff)
downloadbugzilla-7c6954f9189af00752c59112b79c79d8bef49390.tar.gz
bugzilla-7c6954f9189af00752c59112b79c79d8bef49390.tar.xz
Bug 422111: rederive regexp-based group memberships on the destination user after merging Bugzilla accounts, since some of the merged group memberships may no longer apply.
a=LpSolit
Diffstat (limited to 'contrib')
-rw-r--r--contrib/merge-users.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/merge-users.pl b/contrib/merge-users.pl
index 70250a1ee..80c516e04 100644
--- a/contrib/merge-users.pl
+++ b/contrib/merge-users.pl
@@ -49,6 +49,7 @@ use lib qw(. lib);
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Util;
+use Bugzilla::User;
use Getopt::Long;
use Pod::Usage;
@@ -229,6 +230,12 @@ print "OK, records in the 'mailto' column of the 'whine_schedules' table\n" .
# Delete the old record from the profiles table.
$dbh->do('DELETE FROM profiles WHERE userid = ?', undef, $old_id);
+# rederive regexp-based group memberships, because we merged all memberships
+# from all of the accounts, and since the email address isn't the same on
+# them, some of them may no longer match the regexps.
+my $user = new Bugzilla::User($new_id);
+$user->derive_regexp_groups();
+
# Commit the transaction
$dbh->bz_commit_transaction();