diff options
Diffstat (limited to 'httemplate/edit/process/agent_payment_gateway.html')
-rw-r--r-- | httemplate/edit/process/agent_payment_gateway.html | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/httemplate/edit/process/agent_payment_gateway.html b/httemplate/edit/process/agent_payment_gateway.html index 436317ec4..5b5fd948a 100644 --- a/httemplate/edit/process/agent_payment_gateway.html +++ b/httemplate/edit/process/agent_payment_gateway.html @@ -1,26 +1,29 @@ -% -% -%$cgi->param('agentnum') =~ /(\d+)$/ or die "illegal agentnum"; -%my $agent = qsearchs('agent', { 'agentnum' => $1 } ); -%die "agentnum $1 not found" unless $agent; -% -%#my $old -% -%my @new = map { -% my $cardtype = $_; -% new FS::agent_payment_gateway { -% ( map { $_ => scalar($cgi->param($_)) } -% fields('agent_payment_gateway') -% ), -% 'cardtype' => $cardtype, -% }; -% } -% $cgi->param('cardtype'); -% -%foreach my $new (@new) { -% my $error = $new->insert; -% die $error if $error; -%} -% -% <% $cgi->redirect(popurl(3). "browse/agent.cgi") %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +$cgi->param('agentnum') =~ /(\d+)$/ or die "illegal agentnum"; +my $agent = qsearchs('agent', { 'agentnum' => $1 } ); +die "agentnum $1 not found" unless $agent; + +#my $old + +my @new = map { + my $cardtype = $_; + new FS::agent_payment_gateway { + ( map { $_ => scalar($cgi->param($_)) } + fields('agent_payment_gateway') + ), + 'cardtype' => $cardtype, + }; + } + $cgi->param('cardtype'); + +foreach my $new (@new) { + my $error = $new->insert; + die $error if $error; +} + +</%init> |