Fix for bug 95743: the role-accessible checkboxes were getting cleared if a user…

Fix for bug 95743: the role-accessible checkboxes were getting cleared if a user with group access had to log in to make changes to a public bug. Patch by Myk Melez <myk@mozilla.org> r= justdave@syndicomm.com
parent 71e0de63
...@@ -380,13 +380,11 @@ if ($::usergroupset ne '0') { ...@@ -380,13 +380,11 @@ if ($::usergroupset ne '0') {
} }
} }
# If the user is a member of an active bug group, then they also have the # If the bug is restricted to a group, display checkboxes that allow
# ability to determine whether or not the reporter, assignee, QA contact, # the user to set whether or not the reporter, assignee, QA contact,
# or users on the cc: list should be able to see the bug even when they # and cc list can see the bug even if they are not members of all
# are not members of the groups to which the bug is restricted, so display # groups to which the bug is restricted.
# checkboxes that allow the user to make these determinations. if ( $bug{'groupset'} != 0 ) {
SendSQL("SELECT bit FROM groups WHERE bit & $::usergroupset != 0 AND isbuggroup != 0 AND isactive = 1");
if ( FetchSQLData() ) {
# Determine whether or not the bug is always accessible by the reporter, # Determine whether or not the bug is always accessible by the reporter,
# QA contact, and/or users on the cc: list. # QA contact, and/or users on the cc: list.
SendSQL("SELECT reporter_accessible , assignee_accessible , SendSQL("SELECT reporter_accessible , assignee_accessible ,
......
...@@ -528,17 +528,15 @@ if (defined $::FORM{'qa_contact'}) { ...@@ -528,17 +528,15 @@ if (defined $::FORM{'qa_contact'}) {
} }
# If the user is submitting changes from show_bug.cgi for a single bug,
# and that bug is restricted to a group, process the checkboxes that
# If the user is submitting changes from show_bug.cgi for a single bug # allowed the user to set whether or not the reporter, assignee, QA contact,
# and they have access to an active bug group, process the flags that # and cc list can see the bug even if they are not members of all groups
# indicate whether or not the reporter, assignee, QA contact, and users # to which the bug is restricted.
# on the CC list can see the bug regardless of its group restrictions.
if ( $::FORM{'id'} ) { if ( $::FORM{'id'} ) {
SendSQL("SELECT bit FROM groups WHERE bit & $::usergroupset != 0 SendSQL("SELECT groupset FROM bugs WHERE bug_id = $::FORM{'id'}");
AND isbuggroup != 0 AND isactive = 1"); my ($groupset) = FetchSQLData();
my ($groupbits) = FetchSQLData(); if ( $groupset ) {
if ( $groupbits ) {
DoComma(); DoComma();
$::FORM{'reporter_accessible'} = $::FORM{'reporter_accessible'} ? '1' : '0'; $::FORM{'reporter_accessible'} = $::FORM{'reporter_accessible'} ? '1' : '0';
$::query .= "reporter_accessible = $::FORM{'reporter_accessible'}"; $::query .= "reporter_accessible = $::FORM{'reporter_accessible'}";
...@@ -1111,13 +1109,6 @@ The changes made were: ...@@ -1111,13 +1109,6 @@ The changes made were:
&& $::FORM{'product'} ne $::dontchange && $::FORM{'product'} ne $::dontchange
&& $::FORM{'product'} ne $oldhash{'product'} && $::FORM{'product'} ne $oldhash{'product'}
) { ) {
# DEBUGGING INSTRUCTIONS THAT WILL GO AWAY ONCE THIS PATCH IS READY
print qq|<p>\n|;
print qq|<em>usebuggroups</em> is enabled and this bug has changed from the
<em>$oldhash{'product'}</em> to the <em>$::FORM{'product'}</em> product,
so it is time to check if we have to remove the bug from its old product
group or add it to its new product group.<br>\n|;
# END DEBUGGING INSTRUCTIONS THAT WILL GO AWAY ONCE THIS PATCH IS READY
if ( if (
# the user wants to add the bug to the new product's group; # the user wants to add the bug to the new product's group;
($::FORM{'addtonewgroup'} eq 'yes' ($::FORM{'addtonewgroup'} eq 'yes'
...@@ -1148,15 +1139,6 @@ The changes made were: ...@@ -1148,15 +1139,6 @@ The changes made were:
) { ) {
# Add the bug to the group associated with its new product. # Add the bug to the group associated with its new product.
my $groupbit = GroupNameToBit($::FORM{'product'}); my $groupbit = GroupNameToBit($::FORM{'product'});
# DEBUGGING INSTRUCTIONS THAT WILL GO AWAY ONCE THIS PATCH IS READY
print qq|
The user specified <em>addtonewgroup</em>, there is a group
associated with the new product, the user is a member of that
group (or <em>usebuggroupsentry</em> is off), and the group
is active, so we have to add the product to the group:<br>
<code>UPDATE bugs SET groupset = groupset + $groupbit WHERE bug_id = $id</code><br>
|;
# END DEBUGGING INSTRUCTIONS THAT WILL GO AWAY ONCE THIS PATCH IS READY
SendSQL("UPDATE bugs SET groupset = groupset + $groupbit WHERE bug_id = $id"); SendSQL("UPDATE bugs SET groupset = groupset + $groupbit WHERE bug_id = $id");
} }
...@@ -1168,14 +1150,7 @@ The changes made were: ...@@ -1168,14 +1150,7 @@ The changes made were:
&& BugInGroup($id, $oldhash{'product'}) && BugInGroup($id, $oldhash{'product'})
) { ) {
# Remove the bug from the group associated with its old product. # Remove the bug from the group associated with its old product.
# DEBUGGING INSTRUCTIONS THAT WILL GO AWAY ONCE THIS PATCH IS READY
my $groupbit = GroupNameToBit($oldhash{'product'}); my $groupbit = GroupNameToBit($oldhash{'product'});
print qq|
There is a group associated with the old product, the bug is a
member of that group, so remove the bug from the group:<br>
UPDATE bugs SET groupset = groupset - $groupbit WHERE bug_id = $id<br>
|;
# END DEBUGGING INSTRUCTIONS THAT WILL GO AWAY ONCE THIS PATCH IS READY
SendSQL("UPDATE bugs SET groupset = groupset - $groupbit WHERE bug_id = $id"); SendSQL("UPDATE bugs SET groupset = groupset - $groupbit WHERE bug_id = $id");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment