summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/addr_block/add.cgi
blob: e9f9b97366db9846d90d85934ffdf84f2439fc6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
%
%
%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");
%} 
%

<%init>

my $conf = new FS::Conf;
die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');

</%init>