]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Oops! canconfirm bit wasn't actually working.
authorterry%mozilla.org <>
Wed, 8 Mar 2000 05:29:19 +0000 (05:29 +0000)
committerterry%mozilla.org <>
Wed, 8 Mar 2000 05:29:19 +0000 (05:29 +0000)
process_bug.cgi

index ae55fd8da4c218ec48e8e2505cfcb341c7de66d5..0e11f16cc59a098ce0709c9c84719785a4ec6b16 100755 (executable)
@@ -146,13 +146,8 @@ sub CheckCanChangeField {
                 "WHERE bug_id = $bugid");
         ($reporterid, $ownerid, $qacontactid) = (FetchSQLData());
     }
-    if ($reporterid eq $whoid || $ownerid eq $whoid || $qacontactid eq $whoid) {
-        if ($f ne "bug_status") {
-            return 1;
-        }
-        if ($newvalue eq $::unconfirmedstate || !IsOpenedState($newvalue)) {
-            return 1;
-        }
+    if ($f eq "bug_status" && $newvalue ne $::unconfirmedstate &&
+        IsOpenedState($newvalue)) {
 
         # Hmm.  They are trying to set this bug to some opened state
         # that isn't the UNCONFIRMED state.  Are they in the right
@@ -165,16 +160,14 @@ sub CheckCanChangeField {
         if ($UserInCanConfirmGroupSet) {
             return 1;
         }
-        my $fieldid = GetFieldID("bug_status");
-        SendSQL("SELECT newvalue FROM bugs_activity " .
-                "WHERE fieldid = $fieldid " .
-                "  AND oldvalue = '$::unconfirmedstate'");
-        while (MoreSQLData()) {
-            my $n = FetchOneColumn();
-            if (IsOpenedState($n) && $n ne $::unconfirmedstate) {
-                return 1;
-            }
+        SendSQL("SELECT everconfirmed FROM bugs WHERE bug_id = $bugid");
+        my $everconfirmed = FetchOneColumn();
+        if ($everconfirmed) {
+            return 1;
         }
+    } elsif ($reporterid eq $whoid || $ownerid eq $whoid ||
+             $qacontactid eq $whoid) {
+        return 1;
     }
     SendSQL("UNLOCK TABLES");
     $oldvalue = value_quote($oldvalue);