From f162521444148d622df3b42a8304b6cce8f2150e Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Thu, 6 Jul 2006 13:12:04 +0000 Subject: Bug 173629: Clean up "my" variable scoping issues for mod_perl Patch By Max Kanat-Alexander r=LpSolit, a=myk --- editflagtypes.cgi | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'editflagtypes.cgi') diff --git a/editflagtypes.cgi b/editflagtypes.cgi index 825fa1eb5..61dafa923 100755 --- a/editflagtypes.cgi +++ b/editflagtypes.cgi @@ -44,8 +44,9 @@ use Bugzilla::Attachment; use List::Util qw(reduce); -my $template = Bugzilla->template; -my $vars = {}; +local our $cgi = Bugzilla->cgi; +local our $template = Bugzilla->template; +local our $vars = {}; # Make sure the user is logged in and is an administrator. my $user = Bugzilla->login(LOGIN_REQUIRED); @@ -54,8 +55,6 @@ $user->in_group('editcomponents') action => "edit", object => "flagtypes"}); -my $cgi = Bugzilla->cgi; - ################################################################################ # Main Body Execution ################################################################################ @@ -75,9 +74,9 @@ if (@categoryActions = grep(/^categoryAction-.+/, $cgi->param())) { } if ($action eq 'list') { list(); } -elsif ($action eq 'enter') { edit(); } -elsif ($action eq 'copy') { edit(); } -elsif ($action eq 'edit') { edit(); } +elsif ($action eq 'enter') { edit($action); } +elsif ($action eq 'copy') { edit($action); } +elsif ($action eq 'edit') { edit($action); } elsif ($action eq 'insert') { insert(); } elsif ($action eq 'update') { update(); } elsif ($action eq 'confirmdelete') { confirmDelete(); } @@ -167,6 +166,7 @@ sub list { sub edit { + my ($action) = @_; $action eq 'enter' ? validateTargetType() : (my $id = validateID()); my $dbh = Bugzilla->dbh; @@ -365,6 +365,7 @@ sub update { validateGroups(); my $dbh = Bugzilla->dbh; + my $user = Bugzilla->user; $dbh->bz_lock_tables('flagtypes WRITE', 'products READ', 'components READ', 'flaginclusions WRITE', 'flagexclusions WRITE'); -- cgit v1.2.3-24-g4f1b