diff options
author | ivan <ivan> | 2006-08-23 22:25:39 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-08-23 22:25:39 +0000 |
commit | 3ce7691203a7737406bf2d4442f7fd84b81f847e (patch) | |
tree | 90658b097da96772224f04771888ac6ca1a940aa /httemplate/edit/process/addr_block | |
parent | 15e561850b61b10a92a46d8f3e316d53d4970087 (diff) |
Will things ever be the same again?
It's the final masonize
Diffstat (limited to 'httemplate/edit/process/addr_block')
-rwxr-xr-x | httemplate/edit/process/addr_block/add.cgi | 39 | ||||
-rwxr-xr-x | httemplate/edit/process/addr_block/allocate.cgi | 49 | ||||
-rwxr-xr-x | httemplate/edit/process/addr_block/deallocate.cgi | 47 | ||||
-rwxr-xr-x | httemplate/edit/process/addr_block/split.cgi | 37 |
4 files changed, 88 insertions, 84 deletions
diff --git a/httemplate/edit/process/addr_block/add.cgi b/httemplate/edit/process/addr_block/add.cgi index 34d799ccd..85780c678 100755 --- a/httemplate/edit/process/addr_block/add.cgi +++ b/httemplate/edit/process/addr_block/add.cgi @@ -1,20 +1,21 @@ -<% +% +% +%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"); +%} +% -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"); -} -%> diff --git a/httemplate/edit/process/addr_block/allocate.cgi b/httemplate/edit/process/addr_block/allocate.cgi index 85b0d7a7a..a94c0320f 100755 --- a/httemplate/edit/process/addr_block/allocate.cgi +++ b/httemplate/edit/process/addr_block/allocate.cgi @@ -1,25 +1,26 @@ -<% -my $error = ''; -my $blocknum = $cgi->param('blocknum'); -my $routernum = $cgi->param('routernum'); +% +%my $error = ''; +%my $blocknum = $cgi->param('blocknum'); +%my $routernum = $cgi->param('routernum'); +% +%my $addr_block = qsearchs('addr_block', { blocknum => $blocknum }); +%my $router = qsearchs('router', { routernum => $routernum }); +% +%if($addr_block) { +% if ($router) { +% $error = $addr_block->allocate($router); +% } else { +% $error = "Cannot find router with routernum $routernum"; +% } +%} else { +% $error = "Cannot find block with blocknum $blocknum"; +%} +% +%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"); +%} +% -my $addr_block = qsearchs('addr_block', { blocknum => $blocknum }); -my $router = qsearchs('router', { routernum => $routernum }); - -if($addr_block) { - if ($router) { - $error = $addr_block->allocate($router); - } else { - $error = "Cannot find router with routernum $routernum"; - } -} else { - $error = "Cannot find block with blocknum $blocknum"; -} - -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"); -} -%> diff --git a/httemplate/edit/process/addr_block/deallocate.cgi b/httemplate/edit/process/addr_block/deallocate.cgi index cfb7ed04d..494c19f75 100755 --- a/httemplate/edit/process/addr_block/deallocate.cgi +++ b/httemplate/edit/process/addr_block/deallocate.cgi @@ -1,24 +1,25 @@ -<% -my $error = ''; -my $blocknum = $cgi->param('blocknum'); +% +%my $error = ''; +%my $blocknum = $cgi->param('blocknum'); +% +%my $addr_block = qsearchs('addr_block', { blocknum => $blocknum }); +% +%if($addr_block) { +% my $router = $addr_block->router; +% if ($router) { +% $error = $addr_block->deallocate($router); +% } else { +% $error = "Block is not allocated to a router"; +% } +%} else { +% $error = "Cannot find block with blocknum $blocknum"; +%} +% +%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"); +%} +% -my $addr_block = qsearchs('addr_block', { blocknum => $blocknum }); - -if($addr_block) { - my $router = $addr_block->router; - if ($router) { - $error = $addr_block->deallocate($router); - } else { - $error = "Block is not allocated to a router"; - } -} else { - $error = "Cannot find block with blocknum $blocknum"; -} - -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"); -} -%> diff --git a/httemplate/edit/process/addr_block/split.cgi b/httemplate/edit/process/addr_block/split.cgi index bb6d4ba3e..617c3f8ce 100755 --- a/httemplate/edit/process/addr_block/split.cgi +++ b/httemplate/edit/process/addr_block/split.cgi @@ -1,19 +1,20 @@ -<% -my $error = ''; -my $blocknum = $cgi->param('blocknum'); -my $addr_block = qsearchs('addr_block', { blocknum => $blocknum }); +% +%my $error = ''; +%my $blocknum = $cgi->param('blocknum'); +%my $addr_block = qsearchs('addr_block', { blocknum => $blocknum }); +% +%if ( $addr_block) { +% $error = $addr_block->split_block; +%} else { +% $error = "Unknown blocknum: $blocknum"; +%} +% +% +%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"); +%} +% -if ( $addr_block) { - $error = $addr_block->split_block; -} else { - $error = "Unknown blocknum: $blocknum"; -} - - -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"); -} -%> |