diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-04-04 15:29:24 +0200 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-04-04 15:29:24 +0200 |
commit | ad6f8c028da9b4aef1b4f2f8db87ef8de4dd6b4f (patch) | |
tree | 2ab25a2a3d9bdc6645d71a1770120911e5ade918 /contrib | |
parent | 752b10671e496ff7a68663c982680c4a6ac41e31 (diff) | |
download | bugzilla-ad6f8c028da9b4aef1b4f2f8db87ef8de4dd6b4f.tar.gz bugzilla-ad6f8c028da9b4aef1b4f2f8db87ef8de4dd6b4f.tar.xz |
Bug 855846 - sanitizeme.pl should disable email for all users as well as filter the email address
r=glob
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/sanitizeme.pl | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/contrib/sanitizeme.pl b/contrib/sanitizeme.pl index a2376f46d..7033006dd 100755 --- a/contrib/sanitizeme.pl +++ b/contrib/sanitizeme.pl @@ -34,14 +34,14 @@ use Getopt::Long; my $dbh = Bugzilla->dbh; -# This SQL is designed to sanitize a copy of a Bugzilla database so that it +# This SQL is designed to sanitize a copy of a Bugzilla database so that it # doesn't contain any information that can't be viewed from a web browser by -# a user who is not logged in. +# a user who is not logged in. # Last validated against Bugzilla version 4.0 my ($dry_run, $from_cron, $keep_attachments, $keep_groups, - $keep_passwords, $keep_insider, $trace) = (0, 0, 0, '', 0, 0, 0); + $keep_passwords, $keep_insider, $trace, $enable_email) = (0, 0, 0, '', 0, 0, 0, 0); my $keep_groups_sql = ''; GetOptions( @@ -52,6 +52,7 @@ GetOptions( "keep-insider" => \$keep_insider, "keep-groups:s" => \$keep_groups, "trace" => \$trace, + "enable-email" => \$enable_email, ) or exit; if ($keep_groups ne '') { @@ -82,6 +83,7 @@ eval { delete_security_groups(); delete_sensitive_user_data(); delete_attachment_data() unless $keep_attachments; + disable_email_delivery() unless $enable_email; print "All done!\n"; $dbh->bz_rollback_transaction() if $dry_run; }; @@ -182,3 +184,12 @@ sub delete_attachment_data { $dbh->do("UPDATE attach_data SET thedata = ''"); } +sub disable_email_delivery { + # turn off email delivery for all users. + print "Turning off email delivery...\n"; + $dbh->do("UPDATE profiles SET disable_mail = 1"); + + # Also clear out the default flag cc as well since they do not + # have to be in the profiles table + $dbh->do("UPDATE flagtypes SET cc_list = NULL"); +} |