ACLs
[freeside.git] / httemplate / edit / process / cust_bill_pay.cgi
index 0025b16..43e6726 100755 (executable)
@@ -1,4 +1,19 @@
-<%
+%if ( $error ) {
+%  $cgi->param('error', $error);
+<% $cgi->redirect(popurl(2). "cust_bill_pay.cgi?". $cgi->query_string ) %>
+%} else {
+<% header('Payment application sucessful') %>
+  <SCRIPT TYPE="text/javascript">
+    window.top.location.reload();
+  </SCRIPT>
+  </BODY>
+  </HTML>
+% } 
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Apply payment') #;
+      || $FS::CurrentUser::CurrentUser->access_right('Post payment'): #remove after 1.7.3
 
 $cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!";
 my $paynum = $1;
@@ -32,12 +47,4 @@ if ($cgi->param('invnum') =~ /^Refund$/) {
 
 my $error = $new->insert;
 
-if ( $error ) {
-  $cgi->param('error', $error);
-  print $cgi->redirect(popurl(2). "cust_bill_pay.cgi?". $cgi->query_string );
-} else {
-  print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
-}
-
-
-%>
+</%init>