diff options
Diffstat (limited to 'editparams.cgi')
-rwxr-xr-x | editparams.cgi | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/editparams.cgi b/editparams.cgi index 79063271a..cbce6405f 100755 --- a/editparams.cgi +++ b/editparams.cgi @@ -31,6 +31,7 @@ use Bugzilla::Config qw(:admin); use Bugzilla::Config::Common; use Bugzilla::Util; use Bugzilla::Error; +use Bugzilla::Token; my $user = Bugzilla->login(LOGIN_REQUIRED); my $cgi = Bugzilla->cgi; @@ -45,6 +46,7 @@ $user->in_group('tweakparams') object => "parameters"}); my $action = trim($cgi->param('action') || ''); +my $token = $cgi->param('token'); my $current_panel = $cgi->param('section') || 'core'; $current_panel =~ /^([A-Za-z0-9_-]+)$/; $current_panel = $1; @@ -66,6 +68,7 @@ foreach my $panel (Bugzilla::Config::param_panels()) { $vars->{panels} = \@panels; if ($action eq 'save' && $current_module) { + check_token_data($token, 'edit_parameters'); my @changes = (); my @module_param_list = "Bugzilla::Config::${current_module}"->get_param_list(1); @@ -125,7 +128,10 @@ if ($action eq 'save' && $current_module) { $vars->{'param_changed'} = \@changes; write_params(); + delete_token($token); } +$vars->{'token'} = issue_session_token('edit_parameters'); + $template->process("admin/params/editparams.html.tmpl", $vars) || ThrowTemplateError($template->error()); |