diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index b2155d057e..dedadd2792 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -4227,7 +4227,7 @@ sub _migrate_group_owners { my $dbh = Bugzilla->dbh; return if $dbh->bz_column_info('groups', 'owner_user_id'); $dbh->bz_add_column('groups', 'owner_user_id', {TYPE => 'INT3'}); - my $nobody = Bugzilla::User->check('nobody@mozilla.org'); + my $nobody = Bugzilla::User->check(Bugzilla->localconfig->nobody_user); $dbh->do('UPDATE groups SET owner_user_id = ?', undef, $nobody->id); } diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm index fdb1a0d0c0..c4c249709d 100644 --- a/Bugzilla/Install/Localconfig.pm +++ b/Bugzilla/Install/Localconfig.pm @@ -97,6 +97,7 @@ use constant LOCALCONFIG_VARS => ( {name => 'memcached_namespace', default => "bugzilla:",}, {name => 'urlbase', default => '',}, {name => 'canonical_urlbase', lazy => 1}, + {name => 'nobody_user', default => 'nobody@mozilla.org'}, {name => 'attachment_base', default => '',}, {name => 'ses_username', default => '',}, {name => 'ses_password', default => '',}, diff --git a/Bugzilla/Test/MockParams.pm b/Bugzilla/Test/MockParams.pm index 8ad21920c9..5f5abbff0f 100644 --- a/Bugzilla/Test/MockParams.pm +++ b/Bugzilla/Test/MockParams.pm @@ -54,13 +54,14 @@ sub import { $answers{user_info_class} //= 'GitHubAuth,CGI'; $answers{user_verify_class} //= 'GitHubAuth,DB'; - if ($first_time++) { + if ($first_time++ == 0) { capture_merged { Bugzilla::Config::update_params(); }; } else { Bugzilla::Config::SetParam($_, $answers{$_}) for keys %answers; + Bugzilla::Config::write_params(); } } diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index c46438f99d..a63cd9996e 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -972,7 +972,8 @@ sub object_end_of_create { # Add default searches to new user's footer my $dbh = Bugzilla->dbh; - my $sharer = Bugzilla::User->new({name => 'nobody@mozilla.org'}) or return; + my $sharer = Bugzilla::User->new({name => Bugzilla->localconfig->nobody_user}) + or return; my $group = Bugzilla::Group->new({name => 'everyone'}) or return; foreach my $definition (@default_named_queries) { @@ -1012,7 +1013,7 @@ sub _bug_reporters_hw_os { sub _bug_is_unassigned { my ($self) = @_; my $assignee = $self->assigned_to->login; - return $assignee eq 'nobody@mozilla.org' || $assignee =~ /@(?!invalid).+\.bugs$/; + return $assignee eq Bugzilla->localconfig->nobody_user || $assignee =~ /@(?!invalid).+\.bugs$/; } sub _bug_has_current_patch { @@ -1192,7 +1193,7 @@ sub object_start_of_update { # and the assignee isn't a real person return - unless $new_bug->assigned_to->login eq 'nobody@mozilla.org' + unless $new_bug->assigned_to->login eq Bugzilla->localconfig->nobody_user || $new_bug->assigned_to->login =~ /@(?!invalid).+\.bugs$/; # and the user can set the status to NEW @@ -1927,7 +1928,8 @@ sub _post_employee_incident_bug { my ($investigate_bug, $ssh_key_bug); my $old_user = Bugzilla->user; eval { - Bugzilla->set_user(Bugzilla::User->new({name => 'nobody@mozilla.org'})); + Bugzilla->set_user(Bugzilla::User->new( + {name => Bugzilla->localconfig->nobody_user})); my $new_user = Bugzilla->user; # HACK: User needs to be in the editbugs and primary bug's group to allow diff --git a/extensions/BMO/bin/bug_1093952.pl b/extensions/BMO/bin/bug_1093952.pl index 20a9d10daa..937c5bd2f8 100755 --- a/extensions/BMO/bin/bug_1093952.pl +++ b/extensions/BMO/bin/bug_1093952.pl @@ -55,7 +55,7 @@ print "Press to stop or to continue...\n"; getc(); -my $nobody = Bugzilla::User->check({name => 'nobody@mozilla.org'}); +my $nobody = Bugzilla::User->check({name => Bugzilla->localconfig->nobody_user}); my $field = Bugzilla::Field->check({name => 'status_whiteboard'}); my $when = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); diff --git a/extensions/BMO/bin/migrate-github-pull-requests.pl b/extensions/BMO/bin/migrate-github-pull-requests.pl index b7bdd0d680..82603b0fdf 100755 --- a/extensions/BMO/bin/migrate-github-pull-requests.pl +++ b/extensions/BMO/bin/migrate-github-pull-requests.pl @@ -23,7 +23,7 @@ use Bugzilla::Util qw(trim); my $dbh = Bugzilla->dbh; -my $nobody = Bugzilla::User->check({name => 'nobody@mozilla.org'}); +my $nobody = Bugzilla::User->check({name => Bugzilla->localconfig->nobody_user}); my $field = Bugzilla::Field->check({name => 'attachments.mimetype'}); # grab list of suitable attachments diff --git a/extensions/BMO/template/en/default/pages/group_admins.html.tmpl b/extensions/BMO/template/en/default/pages/group_admins.html.tmpl index 7921da071a..db29fb44a6 100644 --- a/extensions/BMO/template/en/default/pages/group_admins.html.tmpl +++ b/extensions/BMO/template/en/default/pages/group_admins.html.tmpl @@ -41,7 +41,7 @@ [% group.name FILTER html %] - [% IF group.owner.login == 'nobody@mozilla.org' %] + [% IF group.owner.login == Bugzilla.localconfig.nobody_user %] – [% ELSE %] [% INCLUDE global/user.html.tmpl who = group.owner %] diff --git a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl index 504dbcd1ae..de0ccb1f60 100644 --- a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl +++ b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl @@ -19,7 +19,7 @@ # these are used in a few places is_cced = bug.cc.contains(user.login); - unassigned = (bug.assigned_to.login == "nobody@mozilla.org") + unassigned = (bug.assigned_to.login == Bugzilla.localconfig.nobody_user) || (bug.assigned_to.login.search('@(?!invalid).+\.bugs$')); # custom fields that have custom rendering, or should not be rendered diff --git a/extensions/ComponentWatching/Extension.pm b/extensions/ComponentWatching/Extension.pm index 1f4c64da5c..9bd6a7fcf5 100644 --- a/extensions/ComponentWatching/Extension.pm +++ b/extensions/ComponentWatching/Extension.pm @@ -23,7 +23,6 @@ use Bugzilla::Util qw(detaint_natural trim); our $VERSION = '2'; use constant REQUIRE_WATCH_USER => 1; -use constant DEFAULT_ASSIGNEE => 'nobody@mozilla.org'; use constant REL_COMPONENT_WATCHER => 15; @@ -100,7 +99,7 @@ sub template_before_create { sub template_before_process { my ($self, $args) = @_; return unless $args->{file} eq 'admin/components/create.html.tmpl'; - $args->{vars}{comp}{default_assignee}{login} = DEFAULT_ASSIGNEE; + $args->{vars}{comp}{default_assignee}{login} = Bugzilla->localconfig->nobody_user; } # diff --git a/extensions/PhabBugz/lib/Util.pm b/extensions/PhabBugz/lib/Util.pm index 3c1bd26403..f6d4690019 100644 --- a/extensions/PhabBugz/lib/Util.pm +++ b/extensions/PhabBugz/lib/Util.pm @@ -129,7 +129,7 @@ sub get_bug_role_phids { } sub is_bug_assigned { - return $_[0]->assigned_to->email ne 'nobody@mozilla.org'; + return $_[0]->assigned_to->email ne Bugzilla->localconfig->nobody_user; } sub is_attachment_phab_revision { diff --git a/extensions/Review/bin/migrate_mentor_from_whiteboard.pl b/extensions/Review/bin/migrate_mentor_from_whiteboard.pl index e9a6230963..e807ffd7d7 100755 --- a/extensions/Review/bin/migrate_mentor_from_whiteboard.pl +++ b/extensions/Review/bin/migrate_mentor_from_whiteboard.pl @@ -36,7 +36,7 @@ <>; # we need to be logged in to do user searching and update bugs -my $nobody = Bugzilla::User->check({name => 'nobody@mozilla.org'}); +my $nobody = Bugzilla::User->check({name => Bugzilla->localconfig->nobody_user}); $nobody->{groups} = [Bugzilla::Group->get_all]; Bugzilla->set_user($nobody); diff --git a/extensions/Review/lib/WebService.pm b/extensions/Review/lib/WebService.pm index 6f3183c9dd..b6681c456c 100644 --- a/extensions/Review/lib/WebService.pm +++ b/extensions/Review/lib/WebService.pm @@ -53,7 +53,8 @@ sub suggestions { # we always need to be authenticated to perform user matching my $user = Bugzilla->user; if (!$user->id) { - Bugzilla->set_user(Bugzilla::User->check({name => 'nobody@mozilla.org'})); + Bugzilla->set_user(Bugzilla::User->check( + {name => Bugzilla->localconfig->nobody_user})); push @reviewers, @{$bug->mentors}; Bugzilla->set_user($user); } diff --git a/extensions/SecureMail/bin/tct b/extensions/SecureMail/bin/tct old mode 100644 new mode 100755 diff --git a/extensions/TrackingFlags/bin/bug_825946.pl b/extensions/TrackingFlags/bin/bug_825946.pl index 055cec1938..9eb75d3677 100755 --- a/extensions/TrackingFlags/bin/bug_825946.pl +++ b/extensions/TrackingFlags/bin/bug_825946.pl @@ -24,7 +24,7 @@ BEGIN Bugzilla->usage_mode(USAGE_MODE_CMDLINE); my $dbh = Bugzilla->dbh; -my $user = Bugzilla::User->check({name => 'nobody@mozilla.org'}); +my $user = Bugzilla::User->check({name => Bugzilla->localconfig->nobody_user}); my $tf_vis = $dbh->selectall_arrayref(<check({name => 'nobody@mozilla.org'}); +my $nobody = Bugzilla::User->check({name => Bugzilla->localconfig->nobody_user}); # put our nobody user into all groups to avoid permissions issues $nobody->{groups} = [Bugzilla::Group->get_all]; diff --git a/scripts/disable-stale-users.pl b/scripts/disable-stale-users.pl index d289ef01ed..d2cd133559 100755 --- a/scripts/disable-stale-users.pl +++ b/scripts/disable-stale-users.pl @@ -66,7 +66,7 @@ BEGIN components ON components.watch_user = profiles.userid WHERE - profiles.login_name != 'nobody@mozilla.org' + profiles.login_name != ? AND components.id IS NULL AND NOT profiles.login_name LIKE '%.bugs' AND NOT profiles.login_name LIKE '%.tld' @@ -77,14 +77,16 @@ BEGIN profiles.userid EOF +my $nobody = Bugzilla->localconfig->nobody_user; if ($dump_sql) { + $sql =~ s/[?]/"$nobody"/; $sql =~ s/[?]/$date/g; print $sql; exit; } say STDERR "looking for users inactive since $date"; -my $users = $dbh->selectall_arrayref($sql, {Slice => {}}, $date, $date); +my $users = $dbh->selectall_arrayref($sql, {Slice => {}}, $nobody, $date, $date); my $total = scalar @$users; die "no matching users found.\n" unless $total; diff --git a/scripts/eject-users-from-groups.pl b/scripts/eject-users-from-groups.pl index be41b87626..98e3b20a0b 100755 --- a/scripts/eject-users-from-groups.pl +++ b/scripts/eject-users-from-groups.pl @@ -22,7 +22,7 @@ my $dbh = Bugzilla->dbh; my @remove_group_names; -my $nobody_name = 'nobody@mozilla.org'; +my $nobody_name = Bugzilla->localconfig->nobody_user; my $admin_name = 'automation@bmo.tld'; GetOptions( diff --git a/scripts/generate_bmo_data.pl b/scripts/generate_bmo_data.pl index c4860617b4..886f6680b5 100755 --- a/scripts/generate_bmo_data.pl +++ b/scripts/generate_bmo_data.pl @@ -147,7 +147,7 @@ my @users = ( { - login => 'nobody@mozilla.org', + login => Bugzilla->localconfig->nobody_user, realname => 'Nobody; OK to take it and work on it', password => '*' }, @@ -232,7 +232,7 @@ name => 'General', description => 'For bugs in Firefox which do not fit into ' . 'other more specific Firefox components', - initialowner => 'nobody@mozilla.org', + initialowner => Bugzilla->localconfig->nobody_user, initialqaowner => '', initial_cc => [], watch_user => 'general@firefox.bugs' @@ -251,7 +251,7 @@ description => 'This is the component for issues specific to bugzilla.mozilla.org ' . 'that do not belong in other components.', - initialowner => 'nobody@mozilla.org', + initialowner => Bugzilla->localconfig->nobody_user, initialqaowner => '', initial_cc => [], watch_user => 'general@bugzilla.bugs' diff --git a/scripts/move_os.pl b/scripts/move_os.pl index 0117551cf8..0820039516 100755 --- a/scripts/move_os.pl +++ b/scripts/move_os.pl @@ -42,7 +42,8 @@ = $dbh->selectcol_arrayref(q{SELECT bug_id FROM bugs WHERE bugs.op_sys = ?}, undef, $from_os); my $field = Bugzilla::Field->check({name => 'op_sys', cache => 1}); -my $nobody = Bugzilla::User->check({name => 'nobody@mozilla.org', cache => 1}); +my $nobody = Bugzilla::User->check( + {name => Bugzilla->localconfig->nobody_user, cache => 1}); my $bug_count = @$bug_ids; if ($bug_count == 0) { diff --git a/scripts/movebugs.pl b/scripts/movebugs.pl index 376e9a8fff..1cebda5916 100755 --- a/scripts/movebugs.pl +++ b/scripts/movebugs.pl @@ -69,9 +69,11 @@ = $dbh->selectrow_array("SELECT id FROM fielddefs WHERE name = 'component'"); $component_field_id or die "Can't find field ID for 'component' field\n"; -my $user_id = $dbh->selectrow_array( - "SELECT userid FROM profiles WHERE login_name='nobody\@mozilla.org'"); -$user_id or die "Can't find user ID for 'nobody\@mozilla.org'\n"; +my $nobody = Bugzilla->localconfig->nobody_user; +my $user_id + = $dbh->selectrow_array("SELECT userid FROM profiles WHERE login_name=?", + undef, $nobody); +$user_id or die "Can't find user ID for '$nobody'\n"; $dbh->bz_start_transaction(); diff --git a/scripts/nagios_blocker_checker.pl b/scripts/nagios_blocker_checker.pl index 795acc7ccc..7d04f01f60 100755 --- a/scripts/nagios_blocker_checker.pl +++ b/scripts/nagios_blocker_checker.pl @@ -29,7 +29,7 @@ assignee => '', product => '', component => '', - unassigned => 'nobody@mozilla.org', + unassigned => Bugzilla->localconfig->nobody_user, # severities severity => 'major,critical,blocker', diff --git a/scripts/remove_idle_group_members.pl b/scripts/remove_idle_group_members.pl index 1840d9b9f9..3aa357914e 100755 --- a/scripts/remove_idle_group_members.pl +++ b/scripts/remove_idle_group_members.pl @@ -77,7 +77,7 @@ $dbh->bz_commit_transaction(); # nobody@mozilla.org cannot receive email - next if $group->owner->login eq 'nobody@mozilla.org'; + next if $group->owner->login eq Bugzilla->localconfig->nobody_user; _send_email($group, \@users_removed); } diff --git a/scripts/reset_default_user.pl b/scripts/reset_default_user.pl index 99d9a31c9c..5afe9e6da7 100755 --- a/scripts/reset_default_user.pl +++ b/scripts/reset_default_user.pl @@ -54,7 +54,7 @@ sub usage { } # We will need these for entering into bugs_activity -my $who = Bugzilla::User->new({name => 'nobody@mozilla.org'}); +my $who = Bugzilla::User->new({name => Bugzilla->localconfig->nobody_user}); my $field = Bugzilla::Field->new({name => $field_name}); my $product_id = $dbh->selectrow_array("SELECT id FROM products WHERE name = ?", diff --git a/skins/standard/global.css b/skins/standard/global.css index c04a58a128..973cf85df7 100644 --- a/skins/standard/global.css +++ b/skins/standard/global.css @@ -978,8 +978,6 @@ input[type="radio"]:checked { } #header { - height: 48px; - position: fixed; width: 100%; z-index: 5; } diff --git a/t/bmo/comments.t b/t/bmo/comments.t index 08badc3f8a..7a6cfe1f17 100644 --- a/t/bmo/comments.t +++ b/t/bmo/comments.t @@ -36,7 +36,7 @@ my $bug_1 = Bugzilla::Bug->create({ keywords => [], cc => [], comment => 'This is a brand new bug', - assigned_to => 'nobody@mozilla.org', + assigned_to => Bugzilla->localconfig->nobody_user, }); ok($bug_1->id, "got a new bug"); @@ -56,7 +56,7 @@ my $bug_2 = Bugzilla::Bug->create({ keywords => [], cc => [], comment => "This is related to ${urlbase}show_bug.cgi?id=$bug_1_id", - assigned_to => 'nobody@mozilla.org', + assigned_to => Bugzilla->localconfig->nobody_user, }); my $bug_2_id = $bug_2->id; diff --git a/t/sqlite-memory.t b/t/sqlite-memory.t index 6b5d8bfd63..8079f9525b 100644 --- a/t/sqlite-memory.t +++ b/t/sqlite-memory.t @@ -12,7 +12,6 @@ use Test::More; use Test2::Tools::Mock; use Try::Tiny; use Capture::Tiny qw(capture_merged); -use Bugzilla::Test::MockParams; BEGIN { $ENV{LOCALCONFIG_ENV} = 'BMO'; @@ -20,6 +19,7 @@ BEGIN { $ENV{BMO_db_name} = ':memory:'; } use Bugzilla; +use Bugzilla::Test::MockParams; BEGIN { Bugzilla->extensions } diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl index 1fc876d60e..d591eca527 100644 --- a/template/en/default/attachment/create.html.tmpl +++ b/template/en/default/attachment/create.html.tmpl @@ -74,7 +74,7 @@ If you want to assign this [% terms.bug %] to yourself, check the box below.
- [% IF bug.assigned_to.login == "nobody@mozilla.org" || bug.assigned_to.login.search('@(?!invalid).+\.bugs$') %] + [% IF bug.assigned_to.login == Bugzilla.localconfig.nobody_user || bug.assigned_to.login.search('@(?!invalid).+\.bugs$') %] [% take_if_patch = 1 %] [% END %] diff --git a/template/en/default/setup/strings.txt.pl b/template/en/default/setup/strings.txt.pl index 03acdf07ae..2b47653bff 100644 --- a/template/en/default/setup/strings.txt.pl +++ b/template/en/default/setup/strings.txt.pl @@ -239,6 +239,10 @@ END localconfig_canonical_urlbase => <<'END', The URL that is the canonical initial leading part of all URLs. This will be the production URL for a dev site, for instance. +END + localconfig_nobody_user => <<'END', +This is the email address of the "nobody" user, which is used as e.g. the +default user that bugs are assigned to. END localconfig_use_suexec => <<'END', Set this to 1 if Bugzilla runs in an Apache SuexecUserGroup environment.