ACLs
[freeside.git] / httemplate / edit / process / cust_bill_pay.cgi
index fc668bb..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,20 +47,4 @@ if ($cgi->param('invnum') =~ /^Refund$/) {
 
 my $error = $new->insert;
 
-if ( $error ) {
-
-  $cgi->param('error', $error);
-  %><%= $cgi->redirect(popurl(2). "cust_bill_pay.cgi?". $cgi->query_string ) %><%
-
-} else {
-
-  #print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
-
-  %><%= header('Payment application sucessful') %>
-  <SCRIPT TYPE="text/javascript">
-    window.top.location.reload();
-  </SCRIPT>
-
-  </BODY></HTML>
-
-<% } %>
+</%init>