summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/addr_block/deallocate.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit/process/addr_block/deallocate.cgi')
-rwxr-xr-xhttemplate/edit/process/addr_block/deallocate.cgi25
1 files changed, 25 insertions, 0 deletions
diff --git a/httemplate/edit/process/addr_block/deallocate.cgi b/httemplate/edit/process/addr_block/deallocate.cgi
new file mode 100755
index 000000000..494c19f75
--- /dev/null
+++ b/httemplate/edit/process/addr_block/deallocate.cgi
@@ -0,0 +1,25 @@
+%
+%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");
+%}
+%
+