RT# 82949 - changes section name from fees to pricing, better opiton
[freeside.git] / httemplate / edit / process / svc_acct_pop.cgi
index 46ad74d..6e823a8 100755 (executable)
@@ -1,4 +1,16 @@
-<%
+%if ( $error ) {
+%  $cgi->param('error', $error);
+<% $cgi->redirect(popurl(2). "svc_acct_pop.cgi?". $cgi->query_string ) %>
+%} else {
+<% $cgi->redirect(popurl(3). "browse/svc_acct_pop.cgi") %>
+%}
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+die "access denied"
+  unless $curuser->access_right('Dialup configuration')
+      || $curuser->access_right('Dialup global configuration');
 
 my $popnum = $cgi->param('popnum');
 
@@ -18,11 +30,4 @@ if ( $popnum ) {
   $popnum=$new->getfield('popnum');
 }
 
-if ( $error ) {
-  $cgi->param('error', $error);
-  print $cgi->redirect(popurl(2). "svc_acct_pop.cgi?". $cgi->query_string );
-} else {
-  print $cgi->redirect(popurl(3). "browse/svc_acct_pop.cgi");
-}
-
-%>
+</%init>