From 7d677ece7d55266f63924bc64cf2190df7c785a0 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Mon, 4 Sep 2006 23:21:47 +0000 Subject: Bug 283582: Remove UserInGroup in favor of Bugzilla->user->in_group Patch By victory(_RSZ_) r=mkanat, a=myk --- Bugzilla/Bug.pm | 4 ++-- Bugzilla/Search.pm | 12 ++++++------ Bugzilla/Series.pm | 2 +- Bugzilla/Template.pm | 3 --- Bugzilla/User.pm | 8 -------- attachment.cgi | 8 ++++---- buglist.cgi | 8 ++++---- chart.cgi | 12 ++++++------ colchange.cgi | 2 +- describekeywords.cgi | 2 +- editusers.cgi | 2 +- editwhines.cgi | 2 +- enter_bug.cgi | 10 +++++----- post_bug.cgi | 6 +++--- process_bug.cgi | 10 +++++----- query.cgi | 2 +- quips.cgi | 4 ++-- request.cgi | 2 +- sanitycheck.cgi | 2 +- show_bug.cgi | 2 +- summarize_time.cgi | 4 ++-- template/en/default/admin/groups/create.html.tmpl | 9 +++++---- template/en/default/admin/groups/list.html.tmpl | 8 ++++---- template/en/default/attachment/create.html.tmpl | 4 ++-- template/en/default/attachment/edit.html.tmpl | 2 +- template/en/default/attachment/list.html.tmpl | 2 +- template/en/default/bug/comments.html.tmpl | 4 ++-- template/en/default/bug/create/create.html.tmpl | 8 ++++---- template/en/default/bug/edit.html.tmpl | 8 ++++---- template/en/default/bug/show-multiple.html.tmpl | 2 +- template/en/default/bug/show.xml.tmpl | 6 +++--- template/en/default/global/user-error.html.tmpl | 6 +++--- template/en/default/list/edit-multiple.html.tmpl | 2 +- template/en/default/list/list.html.tmpl | 2 +- template/en/default/list/quips.html.tmpl | 4 ++-- template/en/default/reports/create-chart.html.tmpl | 4 ++-- template/en/default/reports/menu.html.tmpl | 2 +- template/en/default/reports/series.html.tmpl | 2 +- template/en/default/search/form.html.tmpl | 2 +- 39 files changed, 87 insertions(+), 97 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 642a71d3f..c984c8a98 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -1266,7 +1266,7 @@ sub GetBugActivity { my $suppjoins = ""; my $suppwhere = ""; if (Bugzilla->params->{"insidergroup"} - && !UserInGroup(Bugzilla->params->{'insidergroup'})) + && !Bugzilla->user->in_group(Bugzilla->params->{'insidergroup'})) { $suppjoins = "LEFT JOIN attachments ON attachments.attach_id = bugs_activity.attach_id"; @@ -1313,7 +1313,7 @@ sub GetBugActivity { || $fieldname eq 'deadline') { $activity_visible = - UserInGroup(Bugzilla->params->{'timetrackinggroup'}) ? 1 : 0; + Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'}) ? 1 : 0; } else { $activity_visible = 1; } diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 92ed27b80..d2d3b4978 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -578,7 +578,7 @@ sub init { my $table = "longdescs_$chartid"; my $extra = ""; if (Bugzilla->params->{"insidergroup"} - && !UserInGroup(Bugzilla->params->{"insidergroup"})) + && !Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"})) { $extra = "AND $table.isprivate < 1"; } @@ -641,7 +641,7 @@ sub init { my $table = "longdescs_$chartseq"; my $extra = ""; if (Bugzilla->params->{"insidergroup"} - && !UserInGroup(Bugzilla->params->{"insidergroup"})) + && !Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"})) { $extra = "AND $table.isprivate < 1"; } @@ -661,7 +661,7 @@ sub init { my $table = "longdescs_$chartseq"; my $extra = ""; if (Bugzilla->params->{"insidergroup"} - && !UserInGroup(Bugzilla->params->{"insidergroup"})) + && !Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"})) { $extra = "AND $table.isprivate < 1"; } @@ -684,7 +684,7 @@ sub init { my $table = "longdescs_$chartid"; my $extra = ""; if (Bugzilla->params->{"insidergroup"} - && !UserInGroup(Bugzilla->params->{"insidergroup"})) + && !Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"})) { $extra = "AND $table.isprivate < 1"; } @@ -793,7 +793,7 @@ sub init { my $dtable = "attachdata_$chartid"; my $extra = ""; if (Bugzilla->params->{"insidergroup"} - && !UserInGroup(Bugzilla->params->{"insidergroup"})) + && !Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"})) { $extra = "AND $atable.isprivate = 0"; } @@ -807,7 +807,7 @@ sub init { my $table = "attachments_$chartid"; my $extra = ""; if (Bugzilla->params->{"insidergroup"} - && !UserInGroup(Bugzilla->params->{"insidergroup"})) + && !Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"})) { $extra = "AND $table.isprivate = 0"; } diff --git a/Bugzilla/Series.pm b/Bugzilla/Series.pm index 011e60168..877f69866 100644 --- a/Bugzilla/Series.pm +++ b/Bugzilla/Series.pm @@ -164,7 +164,7 @@ sub initFromCGI { # Change 'admin' here and in series.html.tmpl, or remove the check # completely, if you want to change who can make series public. - $self->{'public'} = 0 unless UserInGroup('admin'); + $self->{'public'} = 0 unless Bugzilla->user->in_group('admin'); } sub writeToDatabase { diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 58008900f..5c5453231 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -790,9 +790,6 @@ sub create { # started the session. 'sudoer' => sub { return Bugzilla->sudoer; }, - # UserInGroup. Deprecated - use the user.* functions instead - 'UserInGroup' => \&Bugzilla::User::UserInGroup, - # SendBugMail - sends mail about a bug, using Bugzilla::BugMail.pm 'SendBugMail' => sub { my ($id, $mailrecipients) = (@_); diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index c037f317a..81bbb7fc1 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -51,7 +51,6 @@ use Bugzilla::Field; use base qw(Bugzilla::Object Exporter); @Bugzilla::User::EXPORT = qw(is_available_username login_to_id user_id_to_login validate_password - UserInGroup USER_MATCH_MULTIPLE USER_MATCH_FAILED USER_MATCH_SUCCESS MATCH_SKIP_CONFIRM ); @@ -1471,9 +1470,6 @@ sub validate_password { return 1; } -sub UserInGroup { - return exists Bugzilla->user->groups->{$_[0]} ? 1 : 0; -} 1; @@ -1893,10 +1889,6 @@ requirements for length and content), else returns false. If a second password is passed in, this function also verifies that the two passwords match. -=item C - -Takes a name of a group, and returns 1 if a user is in the group, 0 otherwise. - =back =head1 SEE ALSO diff --git a/attachment.cgi b/attachment.cgi index 7292f014d..70cad865c 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -170,7 +170,7 @@ sub validateID ValidateBugID($bugid); if ($isprivate && Bugzilla->params->{"insidergroup"}) { - UserInGroup(Bugzilla->params->{"insidergroup"}) + Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"}) || ThrowUserError("auth_failure", {action => "access", object => "attachment"}); } @@ -398,7 +398,7 @@ sub viewall my $dbh = Bugzilla->dbh; if ( Bugzilla->params->{"insidergroup"} - && !UserInGroup(Bugzilla->params->{"insidergroup"}) ) + && !Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"}) ) { $privacy = "AND isprivate < 1 "; } @@ -450,7 +450,7 @@ sub enter # Retrieve the attachments the user can edit from the database and write # them into an array of hashes where each hash represents one attachment. my $canEdit = ""; - if (!UserInGroup("editbugs")) { + if (!Bugzilla->user->in_group("editbugs")) { $canEdit = "AND submitter_id = " . Bugzilla->user->id; } my $attachments = $dbh->selectall_arrayref( @@ -517,7 +517,7 @@ sub insert # Assign the bug to the user, if they are allowed to take it my $owner = ""; - if ($cgi->param('takebug') && UserInGroup("editbugs")) { + if ($cgi->param('takebug') && Bugzilla->user->in_group("editbugs")) { my @fields = ("assigned_to", "bug_status", "resolution", "everconfirmed", "login_name"); diff --git a/buglist.cgi b/buglist.cgi index 1e8462ffa..d226ec8a8 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -83,7 +83,7 @@ my $dotweak = $cgi->param('tweak') ? 1 : 0; # Log the user in if ($dotweak) { Bugzilla->login(LOGIN_REQUIRED); - UserInGroup("editbugs") + Bugzilla->user->in_group("editbugs") || ThrowUserError("auth_failure", {group => "editbugs", action => "modify", object => "multiple_bugs"}); @@ -717,7 +717,7 @@ if (trim($votes) && !grep($_ eq 'votes', @displaycolumns)) { # Remove the timetracking columns if they are not a part of the group # (happens if a user had access to time tracking and it was revoked/disabled) -if (!UserInGroup(Bugzilla->params->{"timetrackinggroup"})) { +if (!Bugzilla->user->in_group(Bugzilla->params->{"timetrackinggroup"})) { @displaycolumns = grep($_ ne 'estimated_time', @displaycolumns); @displaycolumns = grep($_ ne 'remaining_time', @displaycolumns); @displaycolumns = grep($_ ne 'actual_time', @displaycolumns); @@ -1107,10 +1107,10 @@ $vars->{'urlquerypart'} = $params->canonicalise_query('order', 'cmdtype', 'query_based_on'); $vars->{'order'} = $order; -$vars->{'caneditbugs'} = UserInGroup('editbugs'); +$vars->{'caneditbugs'} = Bugzilla->user->in_group('editbugs'); my @bugowners = keys %$bugowners; -if (scalar(@bugowners) > 1 && UserInGroup('editbugs')) { +if (scalar(@bugowners) > 1 && Bugzilla->user->in_group('editbugs')) { my $suffix = Bugzilla->params->{'emailsuffix'}; map(s/$/$suffix/, @bugowners) if $suffix; my $bugowners = join(",", @bugowners); diff --git a/chart.cgi b/chart.cgi index 680eeb7b5..6fe310c84 100755 --- a/chart.cgi +++ b/chart.cgi @@ -35,8 +35,8 @@ # # JS-less chart creation - hard. # Broken image on error or no data - need to do much better. -# Centralise permission checking, so UserInGroup('editbugs') not scattered -# everywhere. +# Centralise permission checking, so Bugzilla->user->in_group('editbugs') +# not scattered everywhere. # User documentation :-) # # Bonus: @@ -93,13 +93,13 @@ if ($action eq "search") { my $user = Bugzilla->login(LOGIN_REQUIRED); -UserInGroup(Bugzilla->params->{"chartgroup"}) +Bugzilla->user->in_group(Bugzilla->params->{"chartgroup"}) || ThrowUserError("auth_failure", {group => Bugzilla->params->{"chartgroup"}, action => "use", object => "charts"}); # Only admins may create public queries -UserInGroup('admin') || $cgi->delete('public'); +Bugzilla->user->in_group('admin') || $cgi->delete('public'); # All these actions relate to chart construction. if ($action =~ /^(assemble|add|remove|sum|subscribe|unsubscribe)$/) { @@ -224,11 +224,11 @@ sub assertCanEdit { sub assertCanCreate { my ($cgi) = shift; - UserInGroup("editbugs") || ThrowUserError("illegal_series_creation"); + Bugzilla->user->in_group("editbugs") || ThrowUserError("illegal_series_creation"); # Check permission for frequency my $min_freq = 7; - if ($cgi->param('frequency') < $min_freq && !UserInGroup("admin")) { + if ($cgi->param('frequency') < $min_freq && !Bugzilla->user->in_group("admin")) { ThrowUserError("illegal_frequency", { 'minimum' => $min_freq }); } } diff --git a/colchange.cgi b/colchange.cgi index 1ff65b73b..de834b8bc 100755 --- a/colchange.cgi +++ b/colchange.cgi @@ -71,7 +71,7 @@ if (Bugzilla::Keyword::keyword_count()) { push(@masterlist, "keywords"); } -if (UserInGroup(Bugzilla->params->{"timetrackinggroup"})) { +if (Bugzilla->user->in_group(Bugzilla->params->{"timetrackinggroup"})) { push(@masterlist, ("estimated_time", "remaining_time", "actual_time", "percentage_complete", "deadline")); } diff --git a/describekeywords.cgi b/describekeywords.cgi index 12c57ea7f..70c0ba4e0 100755 --- a/describekeywords.cgi +++ b/describekeywords.cgi @@ -36,7 +36,7 @@ my $template = Bugzilla->template; my $vars = {}; $vars->{'keywords'} = Bugzilla::Keyword->get_all_with_bug_count(); -$vars->{'caneditkeywords'} = UserInGroup("editkeywords"); +$vars->{'caneditkeywords'} = Bugzilla->user->in_group("editkeywords"); print Bugzilla->cgi->header(); $template->process("reports/keywords.html.tmpl", $vars) diff --git a/editusers.cgi b/editusers.cgi index 5e990d416..9baf0050f 100755 --- a/editusers.cgi +++ b/editusers.cgi @@ -409,7 +409,7 @@ if ($action eq 'search') { action => "delete", object => "users"}); $vars->{'otheruser'} = $otherUser; - $vars->{'editcomponents'} = UserInGroup('editcomponents'); + $vars->{'editcomponents'} = Bugzilla->user->in_group('editcomponents'); # Find other cross references. $vars->{'assignee_or_qa'} = $dbh->selectrow_array( diff --git a/editwhines.cgi b/editwhines.cgi index 0aed19b7a..800c5385a 100755 --- a/editwhines.cgi +++ b/editwhines.cgi @@ -80,7 +80,7 @@ $user->in_group('bz_canusewhines') object => "reports"}); # May this user send mail to other users? -my $can_mail_others = UserInGroup('bz_canusewhineatothers'); +my $can_mail_others = Bugzilla->user->in_group('bz_canusewhineatothers'); # If the form was submitted, we need to look for what needs to be added or # removed, then what was altered. diff --git a/enter_bug.cgi b/enter_bug.cgi index 1b15d55b0..a138d5edf 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -327,11 +327,11 @@ $vars->{'op_sys'} = get_legal_field_values('op_sys'); $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); $vars->{'assigned_to'} = formvalue('assigned_to'); -$vars->{'assigned_to_disabled'} = !UserInGroup('editbugs'); +$vars->{'assigned_to_disabled'} = !Bugzilla->user->in_group('editbugs'); $vars->{'cc_disabled'} = 0; $vars->{'qa_contact'} = formvalue('qa_contact'); -$vars->{'qa_contact_disabled'} = !UserInGroup('editbugs'); +$vars->{'qa_contact_disabled'} = !Bugzilla->user->in_group('editbugs'); $vars->{'cloned_bug_id'} = $cloned_bug_id; @@ -381,7 +381,7 @@ if ($cloned_bug_id) { if ( !($isprivate) || ( ( Bugzilla->params->{"insidergroup"} ) && - ( UserInGroup(Bugzilla->params->{"insidergroup"}) ) ) + ( Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"}) ) ) ) { $vars->{'comment'} = $cloned_bug->{'longdescs'}->[0]->{'body'}; $vars->{'commentprivacy'} = $isprivate; @@ -505,7 +505,7 @@ foreach my $row (@$grouplist) { || ($membercontrol == CONTROLMAPMANDATORY) || (($othercontrol != CONTROLMAPSHOWN) && ($othercontrol != CONTROLMAPDEFAULT) - && (!UserInGroup($groupname))) + && (!Bugzilla->user->in_group($groupname))) ); my $check; @@ -532,7 +532,7 @@ foreach my $row (@$grouplist) { # Checkbox is checked by default if $control is a default state. $check = (($membercontrol == CONTROLMAPDEFAULT) || (($othercontrol == CONTROLMAPDEFAULT) - && (!UserInGroup($groupname)))); + && (!Bugzilla->user->in_group($groupname)))); } my $group = diff --git a/post_bug.cgi b/post_bug.cgi index 2257d543f..db59750f1 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -217,7 +217,7 @@ foreach my $group (@$groups) { # Add groups required if (($membercontrol == CONTROLMAPMANDATORY) || (($othercontrol == CONTROLMAPMANDATORY) - && (!UserInGroup($groupname)))) { + && (!Bugzilla->user->in_group($groupname)))) { # User had no option, bug needs to be in this group. push(@groupstoadd, $id) } @@ -278,7 +278,7 @@ foreach my $grouptoadd (@groupstoadd) { # Add the initial comment, allowing for the fact that it may be private my $privacy = 0; if (Bugzilla->params->{"insidergroup"} - && UserInGroup(Bugzilla->params->{"insidergroup"})) + && Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"})) { $privacy = $cgi->param('commentprivacy') ? 1 : 0; } @@ -297,7 +297,7 @@ foreach my $ccid (@$cc_ids) { my @all_deps; my $sth_addkeyword = $dbh->prepare(q{ INSERT INTO keywords (bug_id, keywordid) VALUES (?, ?)}); -if (UserInGroup("editbugs")) { +if (Bugzilla->user->in_group("editbugs")) { foreach my $keyword (@keyword_ids) { $sth_addkeyword->execute($id, $keyword); } diff --git a/process_bug.cgi b/process_bug.cgi index e14900245..d9970e7b7 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -156,7 +156,7 @@ foreach my $field ("estimated_time", "work_time", "remaining_time") { } } -if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) { +if (Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'})) { my $wk_time = $cgi->param('work_time'); if ($cgi->param('comment') =~ /^\s*$/ && $wk_time && $wk_time != 0) { ThrowUserError('comment_required'); @@ -592,7 +592,7 @@ umask(0); sub _remove_remaining_time { my $cgi = Bugzilla->cgi; - if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) { + if (Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'})) { if ( defined $cgi->param('remaining_time') && $cgi->param('remaining_time') > 0 ) { @@ -875,7 +875,7 @@ if (defined $cgi->param('id')) { if ( defined $cgi->param('id') && (Bugzilla->params->{"insidergroup"} - && UserInGroup(Bugzilla->params->{"insidergroup"})) ) + && Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"})) ) { my $sth = $dbh->prepare('UPDATE longdescs SET isprivate = ? @@ -1191,7 +1191,7 @@ if ($::comma eq "" } # Process data for Time Tracking fields -if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) { +if (Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'})) { foreach my $field ("estimated_time", "remaining_time") { if (defined $cgi->param($field)) { my $er_time = trim($cgi->param($field)); @@ -1535,7 +1535,7 @@ foreach my $id (@idlist) { $timestamp = $dbh->selectrow_array(q{SELECT NOW()}); my $work_time; - if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) { + if (Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'})) { $work_time = $cgi->param('work_time'); if ($work_time) { # AppendComment (called below) can in theory raise an error, diff --git a/query.cgi b/query.cgi index 7b737d03f..cc2e04903 100755 --- a/query.cgi +++ b/query.cgi @@ -255,7 +255,7 @@ foreach my $val (editable_bug_fields()) { push @chfields, $val; } -if (UserInGroup(Bugzilla->params->{'timetrackinggroup'})) { +if (Bugzilla->user->in_group(Bugzilla->params->{'timetrackinggroup'})) { push @chfields, "work_time"; } else { @chfields = grep($_ ne "estimated_time", @chfields); diff --git a/quips.cgi b/quips.cgi index 06b6b0dd8..bb0e5afff 100755 --- a/quips.cgi +++ b/quips.cgi @@ -76,7 +76,7 @@ if ($action eq "add") { # Add the quip my $approved = (Bugzilla->params->{'quip_list_entry_control'} eq "open") - || UserInGroup('admin') || 0; + || Bugzilla->user->in_group('admin') || 0; my $comment = $cgi->param("quip"); $comment || ThrowUserError("need_quip"); trick_taint($comment); # Used in a placeholder below @@ -115,7 +115,7 @@ if ($action eq 'approve') { } if ($action eq "delete") { - UserInGroup("admin") + Bugzilla->user->in_group("admin") || ThrowUserError("auth_failure", {group => "admin", action => "delete", object => "quips"}); diff --git a/request.cgi b/request.cgi index a3191bb15..0ee7ec955 100755 --- a/request.cgi +++ b/request.cgi @@ -81,7 +81,7 @@ sub queue { my $attach_join_clause = "flags.attach_id = attachments.attach_id"; if (Bugzilla->params->{"insidergroup"} - && !UserInGroup(Bugzilla->params->{"insidergroup"})) + && !Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"})) { $attach_join_clause .= " AND attachments.isprivate < 1"; } diff --git a/sanitycheck.cgi b/sanitycheck.cgi index b085feb9d..1c7ab284f 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -86,7 +86,7 @@ my $template = Bugzilla->template; # and restricting access to this installation's administrators (which # prevents users with a legitimate interest in Bugzilla integrity # from accessing the script). -UserInGroup("editbugs") +Bugzilla->user->in_group("editbugs") || ThrowUserError("auth_failure", {group => "editbugs", action => "run", object => "sanity_check"}); diff --git a/show_bug.cgi b/show_bug.cgi index fda4d1503..06a7b6425 100755 --- a/show_bug.cgi +++ b/show_bug.cgi @@ -119,7 +119,7 @@ if ($cgi->param("field")) { @fieldlist = $cgi->param("field"); } -unless (UserInGroup(Bugzilla->params->{"timetrackinggroup"})) { +unless (Bugzilla->user->in_group(Bugzilla->params->{"timetrackinggroup"})) { @fieldlist = grep($_ !~ /_time$/, @fieldlist); } diff --git a/summarize_time.cgi b/summarize_time.cgi index 7693c988a..26cc04725 100755 --- a/summarize_time.cgi +++ b/summarize_time.cgi @@ -28,7 +28,7 @@ use Bugzilla::Constants; # LOGIN_* use Bugzilla::Bug; # EmitDependList use Bugzilla::Util; # trim use Bugzilla::Error; -use Bugzilla::User; # UserInGroup +use Bugzilla::User; # Bugzilla->user->in_group my $template = Bugzilla->template; my $vars = {}; @@ -404,7 +404,7 @@ my $cgi = Bugzilla->cgi; Bugzilla->switch_to_shadow_db(); -UserInGroup(Bugzilla->params->{"timetrackinggroup"}) +Bugzilla->user->in_group(Bugzilla->params->{"timetrackinggroup"}) || ThrowUserError("auth_failure", {group => "time-tracking", action => "access", object => "timetracking_summaries"}); diff --git a/template/en/default/admin/groups/create.html.tmpl b/template/en/default/admin/groups/create.html.tmpl index a82acf6ce..2b50d73a2 100644 --- a/template/en/default/admin/groups/create.html.tmpl +++ b/template/en/default/admin/groups/create.html.tmpl @@ -51,10 +51,11 @@ -

Name is what is used with the UserInGroup() function in any -customized cgi files you write that use a given group. It can also be used -by people submitting [% terms.bugs %] by email to limit [% terms.abug %] to -a certain set of groups. It may not contain any spaces.

+

Name is what is used with the Bugzilla->user->in_group() +function in any customized cgi files you write that use a given group. +It can also be used by people submitting [% terms.bugs %] by email to +limit [% terms.abug %] to a certain set of groups. It may not contain +any spaces.

Description is what will be shown in the [% terms.bug %] reports to members of the group where they can choose whether diff --git a/template/en/default/admin/groups/list.html.tmpl b/template/en/default/admin/groups/list.html.tmpl index 64e30f9e4..fe32bc53d 100644 --- a/template/en/default/admin/groups/list.html.tmpl +++ b/template/en/default/admin/groups/list.html.tmpl @@ -136,10 +136,10 @@

Add Group

- Name is what is used with the UserInGroup() function in any -customized cgi files you write that use a given group. It can also be used -by people submitting [% terms.bugs %] by email to limit [% terms.abug %] -to a certain set of groups. + Name is what is used with the Bugzilla->user->in_group() +function in any customized cgi files you write that use a given group. +It can also be used by people submitting [% terms.bugs %] by email to +limit [% terms.abug %] to a certain set of groups.

diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl index 043e1226a..3547f6d2e 100644 --- a/template/en/default/attachment/create.html.tmpl +++ b/template/en/default/attachment/create.html.tmpl @@ -54,7 +54,7 @@ [% IF attachments.size %] [% FOREACH attachment = attachments %] [% IF ((attachment.isprivate == 0) || (Param("insidergroup") - && UserInGroup(Param("insidergroup")))) %] + && user.in_group(Param("insidergroup")))) %] [% attachment.id %]: [% attachment.description FILTER html %]
@@ -91,7 +91,7 @@ %] - [% IF (Param("insidergroup") && UserInGroup(Param("insidergroup"))) %] + [% IF (Param("insidergroup") && user.in_group(Param("insidergroup"))) %] Privacy: diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl index 51b941ca5..b7d03a8b9 100644 --- a/template/en/default/attachment/edit.html.tmpl +++ b/template/en/default/attachment/edit.html.tmpl @@ -247,7 +247,7 @@
- [% IF (Param("insidergroup") && UserInGroup(Param("insidergroup"))) %] + [% IF (Param("insidergroup") && user.in_group(Param("insidergroup"))) %] private

[% ELSE %]
diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl index 34f646985..adb927e1a 100644 --- a/template/en/default/attachment/list.html.tmpl +++ b/template/en/default/attachment/list.html.tmpl @@ -32,7 +32,7 @@ [% END %] Actions - [% canseeprivate = !Param("insidergroup") || UserInGroup(Param("insidergroup")) %] + [% canseeprivate = !Param("insidergroup") || user.in_group(Param("insidergroup")) %] [% count = 0 %] [% FOREACH attachment = attachments %] [% count = count + 1 %] diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl index 55a84819f..a4671d89d 100644 --- a/template/en/default/bug/comments.html.tmpl +++ b/template/en/default/bug/comments.html.tmpl @@ -38,7 +38,7 @@ [% DEFAULT start_at = 0 mode = "show" %] -[% isinsider = Param("insidergroup") && UserInGroup(Param("insidergroup")) %] +[% isinsider = Param("insidergroup") && user.in_group(Param("insidergroup")) %] [% sort_order = user.settings.comment_sort_order.value %] [%# NOTE: (start_at > 0) means we came here from a midair collision, @@ -134,7 +134,7 @@ [% END %] - [% IF UserInGroup(Param('timetrackinggroup')) && + [% IF user.in_group(Param('timetrackinggroup')) && (comment.work_time > 0 || comment.work_time < 0) %]
Additional hours worked: diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 33e8b8090..26e95523b 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -258,7 +258,7 @@ function handleWantsAttachment(wants_attachment) {   [%# Calculate the number of rows we can use for flags %] [% num_rows = 6 + (Param("useqacontact") ? 1 : 0) + - (UserInGroup(Param('timetrackinggroup')) ? 3 : 0) + + (user.in_group(Param('timetrackinggroup')) ? 3 : 0) + (Param("usebugaliases") ? 1 : 0) %] @@ -323,7 +323,7 @@ function handleWantsAttachment(wants_attachment) { -[% IF UserInGroup(Param('timetrackinggroup')) %] +[% IF user.in_group(Param('timetrackinggroup')) %] Estimated Hours: @@ -400,7 +400,7 @@ function handleWantsAttachment(wants_attachment) { - [% IF Param("insidergroup") && UserInGroup(Param("insidergroup")) %] + [% IF Param("insidergroup") && user.in_group(Param("insidergroup")) %] @@ -450,7 +450,7 @@ function handleWantsAttachment(wants_attachment) { - [% IF UserInGroup('editbugs') %] + [% IF user.in_group('editbugs') %] [% IF use_keywords %] diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 4cadc2114..c93d08c2b 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -57,7 +57,7 @@ replytext = "(In reply to comment #" + id + ")\n" + replytext + "\n"; - [% IF Param("insidergroup") && UserInGroup(Param("insidergroup")) %] + [% IF Param("insidergroup") && user.in_group(Param("insidergroup")) %] if (document.getElementById('isprivate-'+id).checked) { document.getElementById('newcommentprivacy').checked = 'checked'; } @@ -97,7 +97,7 @@ return text; } -[% IF UserInGroup(Param('timetrackinggroup')) %] +[% IF user.in_group(Param('timetrackinggroup')) %] var fRemainingTime = [% bug.remaining_time %]; // holds the original value function adjustRemainingTime() { // subtracts time spent from remaining time @@ -435,7 +435,7 @@ - [% IF UserInGroup(Param('timetrackinggroup')) %] + [% IF user.in_group(Param('timetrackinggroup')) %]
@@ -561,7 +561,7 @@
: - [% IF Param("insidergroup") && UserInGroup(Param("insidergroup")) %] + [% IF Param("insidergroup") && user.in_group(Param("insidergroup")) %] diff --git a/template/en/default/bug/show-multiple.html.tmpl b/template/en/default/bug/show-multiple.html.tmpl index 35df0abb1..2ebb3a21a 100644 --- a/template/en/default/bug/show-multiple.html.tmpl +++ b/template/en/default/bug/show-multiple.html.tmpl @@ -183,7 +183,7 @@ [% PROCESS dependencies name = "blocked" %] [% END %] - [% IF UserInGroup(Param("timetrackinggroup")) %] + [% IF user.in_group(Param("timetrackinggroup")) %] - [% IF UserInGroup(Param("timetrackinggroup")) %] + [% IF user.in_group(Param("timetrackinggroup")) %]
Time tracking: diff --git a/template/en/default/bug/show.xml.tmpl b/template/en/default/bug/show.xml.tmpl index a941ebc62..a54202675 100644 --- a/template/en/default/bug/show.xml.tmpl +++ b/template/en/default/bug/show.xml.tmpl @@ -67,11 +67,11 @@ [% END %] [% IF displayfields.long_desc %] [% FOREACH c = bug.longdescs %] - [% NEXT IF c.isprivate && !UserInGroup(Param("insidergroup")) %] + [% NEXT IF c.isprivate && !user.in_group(Param("insidergroup")) %] [% c.email FILTER xml %] [% c.time FILTER time FILTER xml %] - [% IF UserInGroup(Param('timetrackinggroup')) && (c.work_time - 0 != 0) %] + [% IF user.in_group(Param('timetrackinggroup')) && (c.work_time - 0 != 0) %] [% PROCESS formattimeunit time_unit = c.work_time FILTER xml %] [% END %] [% c.body FILTER xml %] @@ -81,7 +81,7 @@ [% IF displayfields.attachment %] [% FOREACH a = bug.attachments %] - [% NEXT IF a.isprivate && !UserInGroup(Param("insidergroup")) %] + [% NEXT IF a.isprivate && !user.in_group(Param("insidergroup")) %] 'Creating a component'} %] Sorry, the product [% product FILTER html %] has to have at least one component in order for you to - enter [% terms.abug %] into it.

- [% IF UserInGroup("editcomponents") %] + enter [% terms.abug %] into it.
+ [% IF user.in_group("editcomponents") %] Create a new component. [% ELSE %] @@ -980,7 +980,7 @@ Sorry, the product [% product FILTER html %] has to have at least one version in order for you to enter [% terms.abug %] into it.

- [% IF UserInGroup("editcomponents") %] + [% IF user.in_group("editcomponents") %] Create a new version. [% ELSE %] diff --git a/template/en/default/list/edit-multiple.html.tmpl b/template/en/default/list/edit-multiple.html.tmpl index 958a95cf8..95198dbef 100644 --- a/template/en/default/list/edit-multiple.html.tmpl +++ b/template/en/default/list/edit-multiple.html.tmpl @@ -131,7 +131,7 @@ [% END %]

diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl index cf7215ea3..644cc5ac4 100644 --- a/template/en/default/list/list.html.tmpl +++ b/template/en/default/list/list.html.tmpl @@ -154,7 +154,7 @@ - [% IF UserInGroup(Param('timetrackinggroup')) %] + [% IF user.in_group(Param('timetrackinggroup')) %]
diff --git a/template/en/default/list/quips.html.tmpl b/template/en/default/list/quips.html.tmpl index 5bbbaecc3..a752dce5f 100644 --- a/template/en/default/list/quips.html.tmpl +++ b/template/en/default/list/quips.html.tmpl @@ -85,7 +85,7 @@ [% END %] [% IF show_quips %] - [% IF !UserInGroup('admin') %] + [% IF !user.in_group('admin') %]

Existing quips:

@@ -156,7 +156,7 @@

Those who like their wisdom in large doses can view - [% IF UserInGroup('admin') %] + [% IF user.in_group('admin') %] and edit [% END %] the whole quip list. diff --git a/template/en/default/reports/create-chart.html.tmpl b/template/en/default/reports/create-chart.html.tmpl index f2daeb06a..ee446b1c9 100644 --- a/template/en/default/reports/create-chart.html.tmpl +++ b/template/en/default/reports/create-chart.html.tmpl @@ -188,7 +188,7 @@ function subcatSelected() {

- [% IF user.id == series.creator OR UserInGroup("admin") %] + [% IF user.id == series.creator OR user.in_group("admin") %] Edit | [% END %] @@ -260,7 +260,7 @@ function subcatSelected() { [% END %] -[% IF UserInGroup('editbugs') %] +[% IF user.in_group('editbugs') %]

Create New Data Set

[% END %] diff --git a/template/en/default/reports/menu.html.tmpl b/template/en/default/reports/menu.html.tmpl index 5ac1516d5..f5c18bee2 100644 --- a/template/en/default/reports/menu.html.tmpl +++ b/template/en/default/reports/menu.html.tmpl @@ -64,7 +64,7 @@ plot the status and/or resolution of [% terms.bugs %] against time, for each product in your database. - [% IF UserInGroup(Param("chartgroup")) %] + [% IF user.in_group(Param("chartgroup")) %]
  • New Charts - plot any arbitrary search against time. Far more powerful. diff --git a/template/en/default/reports/series.html.tmpl b/template/en/default/reports/series.html.tmpl index 1d1caf5d4..966c499ff 100644 --- a/template/en/default/reports/series.html.tmpl +++ b/template/en/default/reports/series.html.tmpl @@ -68,7 +68,7 @@  day(s)
    [%# Change 'admin' here and in Series.pm, or remove the check completely, if you want to change who can make series public. %] - [% IF UserInGroup('admin') %] + [% IF user.in_group('admin') %] Visible to all
    diff --git a/template/en/default/search/form.html.tmpl b/template/en/default/search/form.html.tmpl index c6a8f65da..d7b7715fd 100644 --- a/template/en/default/search/form.html.tmpl +++ b/template/en/default/search/form.html.tmpl @@ -316,7 +316,7 @@ function doOnSelectProduct(selectmode) { [% END %] [%# Deadline %] - [% IF UserInGroup(Param("timetrackinggroup")) %] + [% IF user.in_group(Param("timetrackinggroup")) %]
  • : -- cgit v1.2.3-24-g4f1b