Bug 505038: Use $user->is_insider instead of $user->in_group(Bugzilla->params->{'insidergroup'}) - Patch by XqueZme <xquezme@gmail.com> r/a=LpSolit
git-svn-id: svn://10.0.0.236/trunk@258956 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
2331c7b4fa
commit
fe60bd7aa2
@ -3085,8 +3085,7 @@ sub GetBugActivity {
|
|||||||
# Only includes attachments the user is allowed to see.
|
# Only includes attachments the user is allowed to see.
|
||||||
my $suppjoins = "";
|
my $suppjoins = "";
|
||||||
my $suppwhere = "";
|
my $suppwhere = "";
|
||||||
if (Bugzilla->params->{"insidergroup"}
|
if (!Bugzilla->user->is_insider)
|
||||||
&& !Bugzilla->user->in_group(Bugzilla->params->{'insidergroup'}))
|
|
||||||
{
|
{
|
||||||
$suppjoins = "LEFT JOIN attachments
|
$suppjoins = "LEFT JOIN attachments
|
||||||
ON attachments.attach_id = bugs_activity.attach_id";
|
ON attachments.attach_id = bugs_activity.attach_id";
|
||||||
|
|||||||
@ -512,7 +512,7 @@ sub process_bug {
|
|||||||
$long_desc{'isprivate'} = $comment->{'att'}->{'isprivate'} || 0;
|
$long_desc{'isprivate'} = $comment->{'att'}->{'isprivate'} || 0;
|
||||||
|
|
||||||
# if one of the comments is private we need to set this flag
|
# 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;
|
$private = 1;
|
||||||
}
|
}
|
||||||
my $data = $comment->field('thetext');
|
my $data = $comment->field('thetext');
|
||||||
@ -1198,7 +1198,7 @@ sub process_bug {
|
|||||||
$err .= "No attachment ID specified, dropping attachment\n";
|
$err .= "No attachment ID specified, dropping attachment\n";
|
||||||
next;
|
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 .= "Exporter not in insidergroup and attachment marked private.\n";
|
||||||
$err .= " Marking attachment public\n";
|
$err .= " Marking attachment public\n";
|
||||||
$att->{'isprivate'} = 0;
|
$att->{'isprivate'} = 0;
|
||||||
|
|||||||
@ -55,8 +55,7 @@
|
|||||||
<em>(optional) Check each existing attachment made obsolete by your new attachment.</em><br>
|
<em>(optional) Check each existing attachment made obsolete by your new attachment.</em><br>
|
||||||
[% IF attachments.size %]
|
[% IF attachments.size %]
|
||||||
[% FOREACH attachment = attachments %]
|
[% FOREACH attachment = attachments %]
|
||||||
[% IF ((attachment.isprivate == 0) || (Param("insidergroup")
|
[% IF ((attachment.isprivate == 0) || user.is_insider) %]
|
||||||
&& user.in_group(Param("insidergroup")))) %]
|
|
||||||
<input type="checkbox" id="[% attachment.id %]"
|
<input type="checkbox" id="[% attachment.id %]"
|
||||||
name="obsolete" value="[% attachment.id %]">
|
name="obsolete" value="[% attachment.id %]">
|
||||||
<a href="attachment.cgi?id=[% attachment.id %]&action=edit">[% attachment.id %]: [% attachment.description FILTER html %]</a><br>
|
<a href="attachment.cgi?id=[% attachment.id %]&action=edit">[% attachment.id %]: [% attachment.description FILTER html %]</a><br>
|
||||||
@ -108,7 +107,7 @@
|
|||||||
%]
|
%]
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
[% IF (Param("insidergroup") && user.in_group(Param("insidergroup"))) %]
|
[% IF user.is_insider %]
|
||||||
<tr>
|
<tr>
|
||||||
<th>Privacy:</th>
|
<th>Privacy:</th>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@ -75,7 +75,7 @@
|
|||||||
replytext = prefix;
|
replytext = prefix;
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
[% IF Param("insidergroup") && user.in_group(Param("insidergroup")) %]
|
[% IF user.is_insider %]
|
||||||
if (document.getElementById('isprivate_' + real_id).checked) {
|
if (document.getElementById('isprivate_' + real_id).checked) {
|
||||||
document.getElementById('newcommentprivacy').checked = 'checked';
|
document.getElementById('newcommentprivacy').checked = 'checked';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
[% IF displayfields.long_desc %]
|
[% IF displayfields.long_desc %]
|
||||||
[% FOREACH c = bug.comments %]
|
[% 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 %]">
|
<long_desc isprivate="[% c.is_private FILTER xml %]">
|
||||||
<commentid>[% c.id FILTER xml %]</commentid>
|
<commentid>[% c.id FILTER xml %]</commentid>
|
||||||
<who name="[% c.author.name FILTER xml %]">[% c.author.email FILTER email FILTER xml %]</who>
|
<who name="[% c.author.name FILTER xml %]">[% c.author.email FILTER email FILTER xml %]</who>
|
||||||
@ -81,7 +81,7 @@
|
|||||||
|
|
||||||
[% IF displayfields.attachment %]
|
[% IF displayfields.attachment %]
|
||||||
[% FOREACH a = bug.attachments %]
|
[% FOREACH a = bug.attachments %]
|
||||||
[% NEXT IF a.isprivate && !user.in_group(Param("insidergroup")) %]
|
[% NEXT IF a.isprivate && !user.is_insider %]
|
||||||
<attachment
|
<attachment
|
||||||
isobsolete="[% a.isobsolete FILTER xml %]"
|
isobsolete="[% a.isobsolete FILTER xml %]"
|
||||||
ispatch="[% a.ispatch FILTER xml %]"
|
ispatch="[% a.ispatch FILTER xml %]"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user