]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 505038: Use $user->is_insider instead of $user->in_group(Bugzilla->params->{...
authorlpsolit%gmail.com <>
Tue, 10 Nov 2009 16:00:10 +0000 (16:00 +0000)
committerlpsolit%gmail.com <>
Tue, 10 Nov 2009 16:00:10 +0000 (16:00 +0000)
Bugzilla/Bug.pm
importxml.pl
template/en/default/attachment/create.html.tmpl
template/en/default/bug/edit.html.tmpl
template/en/default/bug/show.xml.tmpl

index 2a248905d8f60953a322e30244b85d218ab6291e..726316808ad0019ca81db5dbbb24f241c2d27e78 100644 (file)
@@ -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";
index bd4aee186ce10c45ac4c4acf985d38b29c8d4429..f5385d178337e1d37fea620d15930a8127cba05e 100755 (executable)
@@ -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;
index 72844a36e3fd57f9666622233b1a3b06b32a65f2..a6eb038247aa7435697fc3710db148ac6c75487d 100644 (file)
@@ -55,8 +55,7 @@
         <em>(optional) Check each existing attachment made obsolete by your new attachment.</em><br>
         [% IF attachments.size %]
           [% FOREACH attachment = attachments %]
-            [% IF ((attachment.isprivate == 0) || (Param("insidergroup")
-              && user.in_group(Param("insidergroup")))) %]
+            [% IF ((attachment.isprivate == 0) || user.is_insider) %]
               <input type="checkbox" id="[% attachment.id %]"
                    name="obsolete" value="[% attachment.id %]">
               <a href="attachment.cgi?id=[% attachment.id %]&amp;action=edit">[% attachment.id %]: [% attachment.description FILTER html %]</a><br>
         %]
       </td>
     </tr>
-    [% IF (Param("insidergroup") && user.in_group(Param("insidergroup"))) %]
+    [% IF user.is_insider %]
       <tr>
         <th>Privacy:</th>
         <td>
index 006603f59aed094f9697b61a8e6eb0c84c35a61d..853ad72874861715118e1e8b6717eafaeb61fe85 100644 (file)
@@ -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';
       }
index 42464aa14b15109226dff7b9c7dc17f849bcb04e..f4ad0ceda2f9bb14dc292ea7303d89778b9a6805 100644 (file)
@@ -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 %]
           <long_desc isprivate="[% c.is_private FILTER xml %]">
             <commentid>[% c.id FILTER xml %]</commentid>
             <who name="[% c.author.name FILTER xml %]">[% c.author.email FILTER email FILTER xml %]</who>
@@ -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 %]
           <attachment
               isobsolete="[% a.isobsolete FILTER xml %]"
               ispatch="[% a.ispatch FILTER xml %]"