Skip to content

Commit f130a48

Browse files
authored
Merge branch 'master' into have-extension
2 parents a6cd1ba + 22f3a48 commit f130a48

28 files changed

+47
-36
lines changed

Bugzilla/Install/DB.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4227,7 +4227,7 @@ sub _migrate_group_owners {
42274227
my $dbh = Bugzilla->dbh;
42284228
return if $dbh->bz_column_info('groups', 'owner_user_id');
42294229
$dbh->bz_add_column('groups', 'owner_user_id', {TYPE => 'INT3'});
4230-
my $nobody = Bugzilla::User->check('[email protected]');
4230+
my $nobody = Bugzilla::User->check(Bugzilla->localconfig->nobody_user);
42314231
$dbh->do('UPDATE groups SET owner_user_id = ?', undef, $nobody->id);
42324232
}
42334233

Bugzilla/Install/Localconfig.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ use constant LOCALCONFIG_VARS => (
9797
{name => 'memcached_namespace', default => "bugzilla:",},
9898
{name => 'urlbase', default => '',},
9999
{name => 'canonical_urlbase', lazy => 1},
100+
{name => 'nobody_user', default => '[email protected]'},
100101
{name => 'attachment_base', default => '',},
101102
{name => 'ses_username', default => '',},
102103
{name => 'ses_password', default => '',},

Bugzilla/Test/MockParams.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,14 @@ sub import {
5454
$answers{user_info_class} //= 'GitHubAuth,CGI';
5555
$answers{user_verify_class} //= 'GitHubAuth,DB';
5656

57-
if ($first_time++) {
57+
if ($first_time++ == 0) {
5858
capture_merged {
5959
Bugzilla::Config::update_params();
6060
};
6161
}
6262
else {
6363
Bugzilla::Config::SetParam($_, $answers{$_}) for keys %answers;
64+
Bugzilla::Config::write_params();
6465
}
6566
}
6667

extensions/BMO/Extension.pm

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,8 @@ sub object_end_of_create {
972972
# Add default searches to new user's footer
973973
my $dbh = Bugzilla->dbh;
974974

975-
my $sharer = Bugzilla::User->new({name => '[email protected]'}) or return;
975+
my $sharer = Bugzilla::User->new({name => Bugzilla->localconfig->nobody_user})
976+
or return;
976977
my $group = Bugzilla::Group->new({name => 'everyone'}) or return;
977978

978979
foreach my $definition (@default_named_queries) {
@@ -1012,7 +1013,7 @@ sub _bug_reporters_hw_os {
10121013
sub _bug_is_unassigned {
10131014
my ($self) = @_;
10141015
my $assignee = $self->assigned_to->login;
1015-
return $assignee eq '[email protected]' || $assignee =~ /@(?!invalid).+\.bugs$/;
1016+
return $assignee eq Bugzilla->localconfig->nobody_user || $assignee =~ /@(?!invalid).+\.bugs$/;
10161017
}
10171018

10181019
sub _bug_has_current_patch {
@@ -1192,7 +1193,7 @@ sub object_start_of_update {
11921193

11931194
# and the assignee isn't a real person
11941195
return
1195-
unless $new_bug->assigned_to->login eq '[email protected]'
1196+
unless $new_bug->assigned_to->login eq Bugzilla->localconfig->nobody_user
11961197
|| $new_bug->assigned_to->login =~ /@(?!invalid).+\.bugs$/;
11971198

11981199
# and the user can set the status to NEW
@@ -1927,7 +1928,8 @@ sub _post_employee_incident_bug {
19271928
my ($investigate_bug, $ssh_key_bug);
19281929
my $old_user = Bugzilla->user;
19291930
eval {
1930-
Bugzilla->set_user(Bugzilla::User->new({name => '[email protected]'}));
1931+
Bugzilla->set_user(Bugzilla::User->new(
1932+
{name => Bugzilla->localconfig->nobody_user}));
19311933
my $new_user = Bugzilla->user;
19321934

19331935
# HACK: User needs to be in the editbugs and primary bug's group to allow

extensions/BMO/bin/bug_1093952.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
print "Press <Ctrl-C> to stop or <Enter> to continue...\n";
5656
getc();
5757

58-
my $nobody = Bugzilla::User->check({name => '[email protected]'});
58+
my $nobody = Bugzilla::User->check({name => Bugzilla->localconfig->nobody_user});
5959
my $field = Bugzilla::Field->check({name => 'status_whiteboard'});
6060
my $when = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
6161

extensions/BMO/bin/migrate-github-pull-requests.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
use Bugzilla::Util qw(trim);
2424

2525
my $dbh = Bugzilla->dbh;
26-
my $nobody = Bugzilla::User->check({name => '[email protected]'});
26+
my $nobody = Bugzilla::User->check({name => Bugzilla->localconfig->nobody_user});
2727
my $field = Bugzilla::Field->check({name => 'attachments.mimetype'});
2828

2929
# grab list of suitable attachments

extensions/BMO/template/en/default/pages/group_admins.html.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
[% group.name FILTER html %]</span>
4242
</td>
4343
<td nowrap>
44-
[% IF group.owner.login == '[email protected]' %]
44+
[% IF group.owner.login == Bugzilla.localconfig.nobody_user %]
4545
&ndash;
4646
[% ELSE %]
4747
[% INCLUDE global/user.html.tmpl who = group.owner %]

extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
# these are used in a few places
2121
is_cced = bug.cc.contains(user.login);
22-
unassigned = (bug.assigned_to.login == "[email protected]")
22+
unassigned = (bug.assigned_to.login == Bugzilla.localconfig.nobody_user)
2323
|| (bug.assigned_to.login.search('@(?!invalid).+\.bugs$'));
2424

2525
# custom fields that have custom rendering, or should not be rendered

extensions/ComponentWatching/Extension.pm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use Bugzilla::Util qw(detaint_natural trim);
2323
our $VERSION = '2';
2424

2525
use constant REQUIRE_WATCH_USER => 1;
26-
use constant DEFAULT_ASSIGNEE => '[email protected]';
2726

2827
use constant REL_COMPONENT_WATCHER => 15;
2928

@@ -100,7 +99,7 @@ sub template_before_create {
10099
sub template_before_process {
101100
my ($self, $args) = @_;
102101
return unless $args->{file} eq 'admin/components/create.html.tmpl';
103-
$args->{vars}{comp}{default_assignee}{login} = DEFAULT_ASSIGNEE;
102+
$args->{vars}{comp}{default_assignee}{login} = Bugzilla->localconfig->nobody_user;
104103
}
105104

106105
#

extensions/PhabBugz/lib/Util.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ sub get_bug_role_phids {
129129
}
130130

131131
sub is_bug_assigned {
132-
return $_[0]->assigned_to->email ne '[email protected]';
132+
return $_[0]->assigned_to->email ne Bugzilla->localconfig->nobody_user;
133133
}
134134

135135
sub is_attachment_phab_revision {

extensions/Review/bin/migrate_mentor_from_whiteboard.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<>;
3737

3838
# we need to be logged in to do user searching and update bugs
39-
my $nobody = Bugzilla::User->check({name => '[email protected]'});
39+
my $nobody = Bugzilla::User->check({name => Bugzilla->localconfig->nobody_user});
4040
$nobody->{groups} = [Bugzilla::Group->get_all];
4141
Bugzilla->set_user($nobody);
4242

extensions/Review/lib/WebService.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ sub suggestions {
5353
# we always need to be authenticated to perform user matching
5454
my $user = Bugzilla->user;
5555
if (!$user->id) {
56-
Bugzilla->set_user(Bugzilla::User->check({name => '[email protected]'}));
56+
Bugzilla->set_user(Bugzilla::User->check(
57+
{name => Bugzilla->localconfig->nobody_user}));
5758
push @reviewers, @{$bug->mentors};
5859
Bugzilla->set_user($user);
5960
}

extensions/SecureMail/bin/tct

100644100755
File mode changed.

extensions/TrackingFlags/bin/bug_825946.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ BEGIN
2424

2525
Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
2626
my $dbh = Bugzilla->dbh;
27-
my $user = Bugzilla::User->check({name => '[email protected]'});
27+
my $user = Bugzilla::User->check({name => Bugzilla->localconfig->nobody_user});
2828

2929
my $tf_vis = $dbh->selectall_arrayref(<<SQL);
3030
SELECT

extensions/TrackingFlags/bin/bulk_flag_clear.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ BEGIN
104104

105105
# update bugs
106106

107-
my $nobody = Bugzilla::User->check({name => '[email protected]'});
107+
my $nobody = Bugzilla::User->check({name => Bugzilla->localconfig->nobody_user});
108108

109109
# put our nobody user into all groups to avoid permissions issues
110110
$nobody->{groups} = [Bugzilla::Group->get_all];

scripts/disable-stale-users.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ BEGIN
6666
components
6767
ON components.watch_user = profiles.userid
6868
WHERE
69-
profiles.login_name != '[email protected]'
69+
profiles.login_name != ?
7070
AND components.id IS NULL
7171
AND NOT profiles.login_name LIKE '%.bugs'
7272
AND NOT profiles.login_name LIKE '%.tld'
@@ -77,14 +77,16 @@ BEGIN
7777
profiles.userid
7878
EOF
7979

80+
my $nobody = Bugzilla->localconfig->nobody_user;
8081
if ($dump_sql) {
82+
$sql =~ s/[?]/"$nobody"/;
8183
$sql =~ s/[?]/$date/g;
8284
print $sql;
8385
exit;
8486
}
8587

8688
say STDERR "looking for users inactive since $date";
87-
my $users = $dbh->selectall_arrayref($sql, {Slice => {}}, $date, $date);
89+
my $users = $dbh->selectall_arrayref($sql, {Slice => {}}, $nobody, $date, $date);
8890
my $total = scalar @$users;
8991
die "no matching users found.\n" unless $total;
9092

scripts/eject-users-from-groups.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
my $dbh = Bugzilla->dbh;
2424
my @remove_group_names;
25-
my $nobody_name = '[email protected]';
25+
my $nobody_name = Bugzilla->localconfig->nobody_user;
2626
my $admin_name = '[email protected]';
2727

2828
GetOptions(

scripts/generate_bmo_data.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147

148148
my @users = (
149149
{
150-
login => '[email protected]',
150+
login => Bugzilla->localconfig->nobody_user,
151151
realname => 'Nobody; OK to take it and work on it',
152152
password => '*'
153153
},
@@ -232,7 +232,7 @@
232232
name => 'General',
233233
description => 'For bugs in Firefox which do not fit into '
234234
. 'other more specific Firefox components',
235-
initialowner => '[email protected]',
235+
initialowner => Bugzilla->localconfig->nobody_user,
236236
initialqaowner => '',
237237
initial_cc => [],
238238
watch_user => '[email protected]'
@@ -251,7 +251,7 @@
251251
description =>
252252
'This is the component for issues specific to bugzilla.mozilla.org '
253253
. 'that do not belong in other components.',
254-
initialowner => '[email protected]',
254+
initialowner => Bugzilla->localconfig->nobody_user,
255255
initialqaowner => '',
256256
initial_cc => [],
257257
watch_user => '[email protected]'

scripts/move_os.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
= $dbh->selectcol_arrayref(q{SELECT bug_id FROM bugs WHERE bugs.op_sys = ?},
4343
undef, $from_os);
4444
my $field = Bugzilla::Field->check({name => 'op_sys', cache => 1});
45-
my $nobody = Bugzilla::User->check({name => '[email protected]', cache => 1});
45+
my $nobody = Bugzilla::User->check(
46+
{name => Bugzilla->localconfig->nobody_user, cache => 1});
4647

4748
my $bug_count = @$bug_ids;
4849
if ($bug_count == 0) {

scripts/movebugs.pl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@
6969
= $dbh->selectrow_array("SELECT id FROM fielddefs WHERE name = 'component'");
7070
$component_field_id or die "Can't find field ID for 'component' field\n";
7171

72-
my $user_id = $dbh->selectrow_array(
73-
"SELECT userid FROM profiles WHERE login_name='nobody\@mozilla.org'");
74-
$user_id or die "Can't find user ID for 'nobody\@mozilla.org'\n";
72+
my $nobody = Bugzilla->localconfig->nobody_user;
73+
my $user_id
74+
= $dbh->selectrow_array("SELECT userid FROM profiles WHERE login_name=?",
75+
undef, $nobody);
76+
$user_id or die "Can't find user ID for '$nobody'\n";
7577

7678
$dbh->bz_start_transaction();
7779

scripts/nagios_blocker_checker.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
assignee => '',
3030
product => '',
3131
component => '',
32-
unassigned => '[email protected]',
32+
unassigned => Bugzilla->localconfig->nobody_user,
3333

3434
# severities
3535
severity => 'major,critical,blocker',

scripts/remove_idle_group_members.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
$dbh->bz_commit_transaction();
7878

7979
# [email protected] cannot receive email
80-
next if $group->owner->login eq '[email protected]';
80+
next if $group->owner->login eq Bugzilla->localconfig->nobody_user;
8181

8282
_send_email($group, \@users_removed);
8383
}

scripts/reset_default_user.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ sub usage {
5454
}
5555

5656
# We will need these for entering into bugs_activity
57-
my $who = Bugzilla::User->new({name => '[email protected]'});
57+
my $who = Bugzilla::User->new({name => Bugzilla->localconfig->nobody_user});
5858
my $field = Bugzilla::Field->new({name => $field_name});
5959

6060
my $product_id = $dbh->selectrow_array("SELECT id FROM products WHERE name = ?",

skins/standard/global.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,6 @@ input[type="radio"]:checked {
978978
}
979979

980980
#header {
981-
height: 48px;
982-
position: fixed;
983981
width: 100%;
984982
z-index: 5;
985983
}

t/bmo/comments.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ my $bug_1 = Bugzilla::Bug->create({
3636
keywords => [],
3737
cc => [],
3838
comment => 'This is a brand new bug',
39-
assigned_to => '[email protected]',
39+
assigned_to => Bugzilla->localconfig->nobody_user,
4040
});
4141
ok($bug_1->id, "got a new bug");
4242

@@ -56,7 +56,7 @@ my $bug_2 = Bugzilla::Bug->create({
5656
keywords => [],
5757
cc => [],
5858
comment => "This is related to ${urlbase}show_bug.cgi?id=$bug_1_id",
59-
assigned_to => '[email protected]',
59+
assigned_to => Bugzilla->localconfig->nobody_user,
6060
});
6161

6262
my $bug_2_id = $bug_2->id;

t/sqlite-memory.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ use Test::More;
1212
use Test2::Tools::Mock;
1313
use Try::Tiny;
1414
use Capture::Tiny qw(capture_merged);
15-
use Bugzilla::Test::MockParams;
1615

1716
BEGIN {
1817
$ENV{LOCALCONFIG_ENV} = 'BMO';
1918
$ENV{BMO_db_driver} = 'sqlite';
2019
$ENV{BMO_db_name} = ':memory:';
2120
}
2221
use Bugzilla;
22+
use Bugzilla::Test::MockParams;
2323
BEGIN { Bugzilla->extensions }
2424

2525

template/en/default/attachment/create.html.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<td>
7575
<em>If you want to assign this [% terms.bug %] to yourself,
7676
check the box below.</em><br>
77-
[% IF bug.assigned_to.login == "[email protected]" || bug.assigned_to.login.search('@(?!invalid).+\.bugs$') %]
77+
[% IF bug.assigned_to.login == Bugzilla.localconfig.nobody_user || bug.assigned_to.login.search('@(?!invalid).+\.bugs$') %]
7878
[% take_if_patch = 1 %]
7979
[% END %]
8080
<input type="checkbox" id="takebug" name="takebug" value="1" [% IF take_if_patch %] data-take-if-patch="1" [% END %]>

template/en/default/setup/strings.txt.pl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ END
239239
localconfig_canonical_urlbase => <<'END',
240240
The URL that is the canonical initial leading part of all URLs.
241241
This will be the production URL for a dev site, for instance.
242+
END
243+
localconfig_nobody_user => <<'END',
244+
This is the email address of the "nobody" user, which is used as e.g. the
245+
default user that bugs are assigned to.
242246
END
243247
localconfig_use_suexec => <<'END',
244248
Set this to 1 if Bugzilla runs in an Apache SuexecUserGroup environment.

0 commit comments

Comments
 (0)