-%
-%
-%my $error = '';
-%my $ip_gateway = $cgi->param('ip_gateway');
-%my $ip_netmask = $cgi->param('ip_netmask');
-%
-%my $new = new FS::addr_block {
-% ip_gateway => $ip_gateway,
-% ip_netmask => $ip_netmask,
-% routernum => 0 };
-%
-%$error = $new->insert;
-%
-%if ( $error ) {
-% $cgi->param('error', $error);
-% print $cgi->redirect(popurl(4). "browse/addr_block.cgi?". $cgi->query_string );
-%} else {
-% print $cgi->redirect(popurl(4). "browse/addr_block.cgi");
-%}
-%
+<% include( '../elements/process.html',
+ 'table' => 'addr_block',
+ 'redirect' => popurl(4). 'browse/addr_block.cgi?dummy=',
+ 'error_redirect' => popurl(4). 'browse/addr_block.cgi?',
+ 'agent_virt' => 1,
+ 'agent_null_right' => 'Broadband global configuration',
+ )
+%>
<%init>
-my $conf = new FS::Conf;
+my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+ unless $curuser->access_right('Broadband configuration')
+ || $curuser->access_right('Broadband global configuration');
+
+$cgi->param('routernum', 0) # in FS::addr_block::check instead?
+ unless $cgi->param('routernum');
</%init>