summaryrefslogtreecommitdiff
path: root/httemplate/edit/svc_acct.cgi
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-09-04 12:53:30 -0700
committerMark Wells <mark@freeside.biz>2013-09-04 12:53:38 -0700
commit00de593a7e5b5b50aeec62c0ddb90db7bcd62f55 (patch)
treea600ff4184a41d22362c6b8cdfef7e1e47688b7d /httemplate/edit/svc_acct.cgi
parent36ad5e538cb56de33c779e34baf9abdf63c4312e (diff)
assign entire address blocks to services for RADIUS Framed-Route option, #20742
Diffstat (limited to 'httemplate/edit/svc_acct.cgi')
-rwxr-xr-xhttemplate/edit/svc_acct.cgi46
1 files changed, 46 insertions, 0 deletions
diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi
index 574fb51eb..2c694a8fe 100755
--- a/httemplate/edit/svc_acct.cgi
+++ b/httemplate/edit/svc_acct.cgi
@@ -345,6 +345,35 @@
% }
</TR>
+
+% if ( $part_svc->has_router ) {
+<& /elements/hidden.html,
+ field => 'router_routernum',
+ curr_value => $svc_acct->router_routernum
+&>
+<& /elements/tr-input-text.html,
+ label => 'Attached router name',
+ field => 'router_routername',
+ size => 32,
+ curr_value => $svc_acct->router_routername
+&>
+<& /elements/tr-select-table.html,
+ label => 'Attached address block',
+ field => 'router_blocknum',
+ table => 'addr_block',
+ hashref => { 'routernum' => '0' },
+ extra_sql => ($svc_acct->router_routernum ?
+ ' OR routernum = '.$svc_acct->router_routernum : ''),
+ agent_virt => 1,
+ agent_null => 1,
+ name_col => 'cidr',
+ order_by => 'ORDER BY ip_gateway, ip_netmask',
+ empty_label => '(none)',
+ disable_empty => 0,
+ curr_value => $svc_acct->router_blocknum
+&>
+% }
+
% foreach my $field ($svc_acct->virtual_fields) {
% # If the flag is X, it won't even show up in $svc_acct->virtual_fields.
% if ( $part_svc->part_svc_column($field)->columnflag ne 'F' ) {
@@ -525,4 +554,21 @@ if ( $export_google ) {
} #if $error
}
+if ( $part_svc->has_router ) { # duplicates the one in elements/svc_Common
+ if ( $svcnum ) {
+ my $router = qsearchs('router', {svcnum => $svc_acct->svcnum});
+ if ( $router ) {
+ $svc_acct->set("router_$_", $router->get($_))
+ foreach ('routername', 'routernum');
+ my ($block) = $router->addr_block;
+ $svc_acct->set('router_blocknum', $block->blocknum) if ( $block );
+ }
+ }
+ foreach (qw(router_routername router_routernum router_blocknum)) {
+ if ( $cgi->param($_) =~ /^(\w+)$/ ) {
+ $svc_acct->set($_, $1);
+ }
+ }
+}
+
</%init>