ACLs
[freeside.git] / httemplate / edit / process / payment_gateway.html
index b9e4d47..b16bc3d 100644 (file)
@@ -1,4 +1,13 @@
-<%
+%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');
 
@@ -17,17 +26,10 @@ my %options = @options;
 
 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>