summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/addr_block.cgi3
-rw-r--r--httemplate/browse/router.cgi3
-rw-r--r--httemplate/misc/delete-addr_block.html19
3 files changed, 22 insertions, 3 deletions
diff --git a/httemplate/browse/addr_block.cgi b/httemplate/browse/addr_block.cgi
index 7ff0eaa21..46b12e65f 100644
--- a/httemplate/browse/addr_block.cgi
+++ b/httemplate/browse/addr_block.cgi
@@ -158,7 +158,4 @@ my $autoassign_link = sub {
[ "$url;blocknum=", 'blocknum' ];
};
-my $delete_link = sub {
-};
-
</%init>
diff --git a/httemplate/browse/router.cgi b/httemplate/browse/router.cgi
index 541e967dd..069ca9b20 100644
--- a/httemplate/browse/router.cgi
+++ b/httemplate/browse/router.cgi
@@ -9,15 +9,18 @@
'count_query' => "SELECT count(*) from router $count_sql",
'header' => [ 'Router name',
'Address block(s)',
+ 'Action',
],
'fields' => [ 'routername',
sub { join( '<BR>', map { $_->NetAddr }
shift->addr_block
);
},
+ sub { 'Delete' },
],
'links' => [ [ "${p2}edit/router.cgi?", 'routernum' ],
'',
+ [ "${p}misc/delete-router.html?", 'routernum' ],
],
'agent_virt' => 1,
'agent_null_right'=> "Broadband global configuration",
diff --git a/httemplate/misc/delete-addr_block.html b/httemplate/misc/delete-addr_block.html
new file mode 100644
index 000000000..83a4b6823
--- /dev/null
+++ b/httemplate/misc/delete-addr_block.html
@@ -0,0 +1,19 @@
+% if ( $error ) {
+% errorpage($error);
+% } else {
+<% $cgi->redirect("${p}browse/addr_block.cgi") %>
+% }
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Broadband configuration')
+ || $FS::CurrentUser::CurrentUser->access_right('Broadband global configuration');
+
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal blocknum";
+my $blocknum = $1;
+
+my $addr_block = qsearchs('addr_block',{'blocknum'=>$blocknum});
+my $error = $addr_block->delete;
+
+</%init>