diff options
author | bugreport%peshkin.net <> | 2004-07-28 00:13:48 +0200 |
---|---|---|
committer | bugreport%peshkin.net <> | 2004-07-28 00:13:48 +0200 |
commit | fba06c0a5f82ddf2f73ef068752d697666464dc1 (patch) | |
tree | 1e3e2655bdc0553fac9fe7e9ee4b607873f69f3f | |
parent | 667a7abdb6d998df719317e101eb08860f1b78d1 (diff) | |
download | bugzilla-fba06c0a5f82ddf2f73ef068752d697666464dc1.tar.gz bugzilla-fba06c0a5f82ddf2f73ef068752d697666464dc1.tar.xz |
Bug 252450: Unlock tables in edit*.cgi before sending trailer
r=kiko
a=justdave
-rwxr-xr-x | editcomponents.cgi | 9 | ||||
-rwxr-xr-x | editmilestones.cgi | 5 | ||||
-rwxr-xr-x | editproducts.cgi | 6 | ||||
-rwxr-xr-x | editversions.cgi | 5 |
4 files changed, 4 insertions, 21 deletions
diff --git a/editcomponents.cgi b/editcomponents.cgi index 00c06912f..864986d80 100755 --- a/editcomponents.cgi +++ b/editcomponents.cgi @@ -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; diff --git a/editmilestones.cgi b/editmilestones.cgi index e9ec0ed92..aaec24455 100755 --- a/editmilestones.cgi +++ b/editmilestones.cgi @@ -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; diff --git a/editproducts.cgi b/editproducts.cgi index 17bcfd703..99640a44e 100755 --- a/editproducts.cgi +++ b/editproducts.cgi @@ -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; @@ -685,8 +686,6 @@ if ($action eq 'delete') { WHERE id=$product_id"); print "Product '$product' deleted.<BR>\n"; - SendSQL("UNLOCK TABLES"); - unlink "$datadir/versioncache"; PutTrailer($localtrailer); exit; @@ -1059,7 +1058,6 @@ if ($action eq 'updategroupcontrols') { } print "added $count bugs<p>\n"; } - SendSQL("UNLOCK TABLES"); print "Group control updates done<P>\n"; PutTrailer($localtrailer); @@ -1133,7 +1131,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; } @@ -1184,7 +1181,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; } diff --git a/editversions.cgi b/editversions.cgi index a3a2e2cc5..c426891ed 100755 --- a/editversions.cgi +++ b/editversions.cgi @@ -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; |