diff options
author | Mark Wells <mark@freeside.biz> | 2012-10-30 12:16:17 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2012-10-30 12:16:17 -0700 |
commit | 87f255507af9f14dfbccd37eefd71a148f9af344 (patch) | |
tree | 7467e87ff6a27cdbe67fa60f4261e2d07a61f4b7 /httemplate/edit/router.cgi | |
parent | d77fe06b27410a41855e1425114ab8d9cdae4ff0 (diff) |
IP address management for svc_acct, #19567
Diffstat (limited to 'httemplate/edit/router.cgi')
-rwxr-xr-x | httemplate/edit/router.cgi | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/httemplate/edit/router.cgi b/httemplate/edit/router.cgi index fdcd7b3b3..0df9b457e 100755 --- a/httemplate/edit/router.cgi +++ b/httemplate/edit/router.cgi @@ -29,8 +29,15 @@ die "access denied" unless $curuser->access_right('Broadband configuration') || $curuser->access_right('Broadband global configuration'); +my @svc_x = 'svc_broadband'; +if ( FS::Conf->new->exists('svc_acct-ip_addr') ) { + push @svc_x, 'svc_acct'; +} + my $callback = sub { my ($cgi, $object, $fields) = (shift, shift, shift); + + my $extra_sql = ' AND svcdb IN(' . join(',', map { "'$_'" } @svc_x) . ')'; unless ($object->svcnum) { push @{$fields}, { 'type' => 'tablebreak-tr-title', @@ -41,7 +48,8 @@ my $callback = sub { 'target_table' => 'part_svc', 'link_table' => 'part_svc_router', 'name_col' => 'svc', - 'hashref' => { 'svcdb' => 'svc_broadband', 'disabled' => '' }, + 'hashref' => { 'disabled' => '' }, + 'extra_sql' => $extra_sql, }; } }; |