-<%
+%if ( $error ) {
+% $cgi->param('error', $error);
+<% $cgi->redirect(popurl(2). "payment_gateway.html?". $cgi->query_string ) %>
+%} else {
+<% $cgi->redirect(popurl(3). "browse/payment_gateway.html") %>
+%}
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $gatewaynum = $cgi->param('gatewaynum');
my $error;
if ( $gatewaynum ) {
- $error=$new->replace($old);
+ $error=$new->replace($old, \%options);
} else {
$error=$new->insert(\%options);
$gatewaynum=$new->getfield('gatewaynum');
}
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "payment_gateway.html?". $cgi->query_string );
-} else {
- print $cgi->redirect(popurl(3). "browse/payment_gateway.html");
-}
-
-%>
+</%init>