From f7b1e5c5e27780f4bb1be7c9a44f1a91024473e4 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 10 Nov 2009 16:00:10 +0000 Subject: Bug 505038: Use $user->is_insider instead of $user->in_group(Bugzilla->params->{'insidergroup'}) - Patch by XqueZme r/a=LpSolit --- Bugzilla/Bug.pm | 3 +-- importxml.pl | 4 ++-- template/en/default/attachment/create.html.tmpl | 5 ++--- template/en/default/bug/edit.html.tmpl | 2 +- template/en/default/bug/show.xml.tmpl | 4 ++-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 2a248905d..726316808 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -3085,8 +3085,7 @@ sub GetBugActivity { # Only includes attachments the user is allowed to see. my $suppjoins = ""; my $suppwhere = ""; - if (Bugzilla->params->{"insidergroup"} - && !Bugzilla->user->in_group(Bugzilla->params->{'insidergroup'})) + if (!Bugzilla->user->is_insider) { $suppjoins = "LEFT JOIN attachments ON attachments.attach_id = bugs_activity.attach_id"; diff --git a/importxml.pl b/importxml.pl index bd4aee186..f5385d178 100755 --- a/importxml.pl +++ b/importxml.pl @@ -512,7 +512,7 @@ sub process_bug { $long_desc{'isprivate'} = $comment->{'att'}->{'isprivate'} || 0; # if one of the comments is private we need to set this flag - if ( $long_desc{'isprivate'} && $exporter->in_group($params->{'insidergroup'})) { + if ( $long_desc{'isprivate'} && $exporter->is_insider) { $private = 1; } my $data = $comment->field('thetext'); @@ -1198,7 +1198,7 @@ sub process_bug { $err .= "No attachment ID specified, dropping attachment\n"; next; } - if (!$exporter->in_group($params->{'insidergroup'}) && $att->{'isprivate'}){ + if (!$exporter->is_insider) && $att->{'isprivate'}){ $err .= "Exporter not in insidergroup and attachment marked private.\n"; $err .= " Marking attachment public\n"; $att->{'isprivate'} = 0; diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl index 72844a36e..a6eb03824 100644 --- a/template/en/default/attachment/create.html.tmpl +++ b/template/en/default/attachment/create.html.tmpl @@ -55,8 +55,7 @@ (optional) Check each existing attachment made obsolete by your new attachment.
[% IF attachments.size %] [% FOREACH attachment = attachments %] - [% IF ((attachment.isprivate == 0) || (Param("insidergroup") - && user.in_group(Param("insidergroup")))) %] + [% IF ((attachment.isprivate == 0) || user.is_insider) %] [% attachment.id %]: [% attachment.description FILTER html %]
@@ -108,7 +107,7 @@ %] - [% IF (Param("insidergroup") && user.in_group(Param("insidergroup"))) %] + [% IF user.is_insider %] Privacy: diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 006603f59..853ad7287 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -75,7 +75,7 @@ replytext = prefix; [% END %] - [% IF Param("insidergroup") && user.in_group(Param("insidergroup")) %] + [% IF user.is_insider %] if (document.getElementById('isprivate_' + real_id).checked) { document.getElementById('newcommentprivacy').checked = 'checked'; } diff --git a/template/en/default/bug/show.xml.tmpl b/template/en/default/bug/show.xml.tmpl index 42464aa14..f4ad0ceda 100644 --- a/template/en/default/bug/show.xml.tmpl +++ b/template/en/default/bug/show.xml.tmpl @@ -66,7 +66,7 @@ [% IF displayfields.long_desc %] [% FOREACH c = bug.comments %] - [% NEXT IF c.is_private && !user.in_group(Param("insidergroup")) %] + [% NEXT IF c.is_private && !user.is_insider %] [% c.id FILTER xml %] [% c.author.email FILTER email FILTER xml %] @@ -81,7 +81,7 @@ [% IF displayfields.attachment %] [% FOREACH a = bug.attachments %] - [% NEXT IF a.isprivate && !user.in_group(Param("insidergroup")) %] + [% NEXT IF a.isprivate && !user.is_insider %]