new rate editor
[freeside.git] / httemplate / edit / process / rate_region.cgi
index 09d3d2c..3933ff3 100755 (executable)
@@ -1,4 +1,14 @@
-<%
+%if ( $error ) {
+%  $cgi->param('error', $error);
+<% $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string ) %>
+%} else { 
+<% $cgi->redirect(popurl(3). "browse/rate_region.html") %>
+%}
+<%init>
+
+my $conf = new FS::Conf;
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
 
 my $regionnum = $cgi->param('regionnum');
 
@@ -40,12 +50,4 @@ if ( $regionnum ) {
   $regionnum = $new->getfield('regionnum');
 }
 
-if ( $error ) {
-  $cgi->param('error', $error);
-  print $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string );
-} else { 
-  #print $cgi->redirect(popurl(3). "browse/rate_region.cgi");
-  print $cgi->redirect(popurl(3). "browse/rate.cgi");
-}
-
-%>
+</%init>