]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 252450: Unlock tables in edit*.cgi before sending trailer
authorbugreport%peshkin.net <>
Tue, 27 Jul 2004 22:14:51 +0000 (22:14 +0000)
committerbugreport%peshkin.net <>
Tue, 27 Jul 2004 22:14:51 +0000 (22:14 +0000)
patch by marc
r=kiko
a=justdave

editcomponents.cgi
editgroups.cgi
editmilestones.cgi
editproducts.cgi
editusers.cgi
editversions.cgi

index 00c06912f3a7ba53a28f1069ee701b2e4d7c7337..864986d8023350e2d209adac82058333a636726b 100755 (executable)
@@ -162,6 +162,7 @@ sub EmitFormElements ($$$$$)
 sub PutTrailer (@)
 {
     my (@links) = ("Back to the <A HREF=\"query.cgi\">query page</A>", @_);
+    SendSQL("UNLOCK TABLES");
 
     my $count = $#links;
     my $num = 0;
@@ -675,7 +676,6 @@ if ($action eq 'delete') {
     SendSQL("DELETE FROM components
              WHERE id=$component_id");
     print "Components deleted.<P>\n";
-    SendSQL("UNLOCK TABLES");
 
     unlink "$datadir/versioncache";
     PutTrailer($localtrailer);
@@ -782,7 +782,6 @@ if ($action eq 'update') {
         unless ($description) {
             print "Sorry, I can't delete the description.";
             PutTrailer($localtrailer);
-            SendSQL("UNLOCK TABLES");
             exit;
         }
         SendSQL("UPDATE components
@@ -795,7 +794,6 @@ if ($action eq 'update') {
     if ($initialowner ne $initialownerold) {
         unless ($initialowner) {
             print "Sorry, I can't delete the initial owner.";
-            SendSQL("UNLOCK TABLES");
             PutTrailer($localtrailer);
             exit;
         }
@@ -803,7 +801,6 @@ if ($action eq 'update') {
         my $initialownerid = DBname_to_id($initialowner);
         unless ($initialownerid) {
             print "Sorry, you must use an existing Bugzilla account as initial owner.";
-            SendSQL("UNLOCK TABLES");
             PutTrailer($localtrailer);
             exit;
         }
@@ -818,7 +815,6 @@ if ($action eq 'update') {
         my $initialqacontactid = DBname_to_id($initialqacontact);
         if (!$initialqacontactid && $initialqacontact ne '') {
             print "Sorry, you must use an existing Bugzilla account as initial QA contact.";
-            SendSQL("UNLOCK TABLES");
             PutTrailer($localtrailer);
             exit;
         }
@@ -834,13 +830,11 @@ if ($action eq 'update') {
         unless ($component) {
             print "Sorry, but a component must have a name.";
             PutTrailer($localtrailer);
-            SendSQL("UNLOCK TABLES");
             exit;
         }
         if (TestComponent($product,$component)) {
             print "Sorry, component name '$component' is already in use.";
             PutTrailer($localtrailer);
-            SendSQL("UNLOCK TABLES");
             exit;
         }
 
@@ -850,7 +844,6 @@ if ($action eq 'update') {
         unlink "$datadir/versioncache";
         print "Updated component name.<BR>\n";
     }
-    SendSQL("UNLOCK TABLES");
 
     PutTrailer($localtrailer);
     exit;
index 1b2f0d3df613b583f4426e082dfee61e6e7cbb95..21498b0be4bcb57765c0139a13e79d15f83127fb 100755 (executable)
@@ -101,6 +101,7 @@ sub ShowError ($)
 sub PutTrailer (@)
 {
     my (@links) = ("Back to the <a href=\"./\">index</a>", @_);
+    SendSQL("UNLOCK TABLES");
 
     my $count = $#links;
     my $num = 0;
@@ -677,7 +678,6 @@ if (($action eq 'remove_all_regexp') || ($action eq 'remove_all')) {
              SET last_changed = NOW()
              WHERE id = ?");
     $sth->execute($gid);
-    $dbh->do("UNLOCK TABLES");
     PutTrailer("back to the <a href=\"editgroups.cgi\">group list</a>");
     exit;
 }
index e9ec0ed920017c6db6b4630d824699ef616189d4..aaec24455eff8e487373b128ddb64157681b242c 100755 (executable)
@@ -115,6 +115,7 @@ sub EmitFormElements ($$$)
 sub PutTrailer (@)
 {
     my (@links) = ("Back to the <A HREF=\"query.cgi\">query page</A>", @_);
+    SendSQL("UNLOCK TABLES");
 
     my $count = $#links;
     my $num = 0;
@@ -453,7 +454,6 @@ if ($action eq 'delete') {
              WHERE product_id=$product_id
                AND value=" . SqlQuote($milestone));
     print "Milestone deleted.<P>\n";
-    SendSQL("UNLOCK TABLES");
 
     unlink "$datadir/versioncache";
     PutTrailer($localtrailer);
@@ -535,13 +535,11 @@ if ($action eq 'update') {
         unless ($milestone) {
             print "Sorry, I can't delete the milestone text.";
             PutTrailer($localtrailer);
-            SendSQL("UNLOCK TABLES");
             exit;
         }
         if (TestMilestone($product,$milestone)) {
             print "Sorry, milestone '$milestone' is already in use.";
             PutTrailer($localtrailer);
-            SendSQL("UNLOCK TABLES");
             exit;
         }
         SendSQL("UPDATE bugs
@@ -560,7 +558,6 @@ if ($action eq 'update') {
         unlink "$datadir/versioncache";
         print "Updated milestone.<BR>\n";
     }
-    SendSQL("UNLOCK TABLES");
 
     PutTrailer($localtrailer);
     exit;
index c539465af0480c8b0edce33a626be539249b0b02..bff58fa6c5efd8ecc5815f39e573fac8ecff7cdb 100755 (executable)
@@ -149,6 +149,7 @@ sub EmitFormElements ($$$$$$$$)
 sub PutTrailer (@)
 {
     my (@links) = ("Back to the <A HREF=\"query.cgi\">query page</A>", @_);
+    SendSQL("UNLOCK TABLES");
 
     my $count = $#links;
     my $num = 0;
@@ -671,8 +672,6 @@ if ($action eq 'delete') {
              WHERE id=$product_id");
     print "Product '$product' deleted.<BR>\n";
 
-    SendSQL("UNLOCK TABLES");
-
     unlink "$datadir/versioncache";
     PutTrailer($localtrailer);
     exit;
@@ -1045,7 +1044,6 @@ if ($action eq 'updategroupcontrols') {
         }
         print "added $count bugs<p>\n";
     }
-    SendSQL("UNLOCK TABLES");
     print "Group control updates done<P>\n";
 
     PutTrailer($localtrailer);
@@ -1119,7 +1117,6 @@ if ($action eq 'update') {
     if ($description ne $descriptionold) {
         unless ($description) {
             print "Sorry, I can't delete the description.";
-            SendSQL("UNLOCK TABLES");
             PutTrailer($localtrailer);
             exit;
         }
@@ -1170,7 +1167,6 @@ if ($action eq 'update') {
                 "  AND product_id = $product_id");
         if (!FetchOneColumn()) {
             print "Sorry, the milestone $defaultmilestone must be defined first.";
-            SendSQL("UNLOCK TABLES");
             PutTrailer($localtrailer);
             exit;
         }
@@ -1186,13 +1182,11 @@ if ($action eq 'update') {
     if ($product ne $productold) {
         unless ($product) {
             print "Sorry, I can't delete the product name.";
-            SendSQL("UNLOCK TABLES");
             PutTrailer($localtrailer);
             exit;
         }
         if (TestProduct($product)) {
             print "Sorry, product name '$product' is already in use.";
-            SendSQL("UNLOCK TABLES");
             PutTrailer($localtrailer);
             exit;
         }
index d9094370478285d2f09c588352dab3a3ed2f55ac..1cde956b98455e38fb63238e43b2e57b892bad3a 100755 (executable)
@@ -209,6 +209,8 @@ sub EmitFormElements ($$$$)
 sub PutTrailer (@)
 {
     my (@links) = ("Back to the <a href=\"./\">index</a>");
+    SendSQL("UNLOCK TABLES");
+
     if($editall && Bugzilla::Auth->can_edit) {
           push(@links,
               "<a href=\"editusers.cgi?action=add\">add</a> a new user");
index a3a2e2cc5bb4171aff9309286f6c5c5bfdb5684b..c426891edf2ea349e690fa90ce9c0ad237f46682 100755 (executable)
@@ -124,6 +124,7 @@ sub EmitFormElements ($$)
 sub PutTrailer (@)
 {
     my (@links) = ("Back to the <A HREF=\"query.cgi\">query page</A>", @_);
+    SendSQL("UNLOCK TABLES");
 
     my $count = $#links;
     my $num = 0;
@@ -444,7 +445,6 @@ if ($action eq 'delete') {
              WHERE product_id = $product_id
                AND value=" . SqlQuote($version));
     print "Version deleted.<P>\n";
-    SendSQL("UNLOCK TABLES");
 
     unlink "$datadir/versioncache";
     PutTrailer($localtrailer);
@@ -509,13 +509,11 @@ if ($action eq 'update') {
         unless ($version) {
             print "Sorry, I can't delete the version text.";
             PutTrailer($localtrailer);
-            SendSQL("UNLOCK TABLES");
             exit;
         }
         if (TestVersion($product,$version)) {
             print "Sorry, version '$version' is already in use.";
             PutTrailer($localtrailer);
-            SendSQL("UNLOCK TABLES");
             exit;
         }
         SendSQL("UPDATE bugs
@@ -530,7 +528,6 @@ if ($action eq 'update') {
         unlink "$datadir/versioncache";
         print "Updated version.<BR>\n";
     }
-    SendSQL("UNLOCK TABLES");
 
     PutTrailer($localtrailer);
     exit;