diff options
author | jeff <jeff> | 2008-06-28 19:25:24 +0000 |
---|---|---|
committer | jeff <jeff> | 2008-06-28 19:25:24 +0000 |
commit | a1871d3d13c1dafa93b956762c0d23728d261da7 (patch) | |
tree | ecd799ff28ca27d5e2ef07a615bcac49621dd391 /httemplate/browse | |
parent | 7588be4eb948426b972d0238dcdbb1537dc6a72a (diff) |
agent virtualize address blocks and routers
Diffstat (limited to 'httemplate/browse')
-rw-r--r-- | httemplate/browse/addr_block.cgi | 25 | ||||
-rw-r--r-- | httemplate/browse/router.cgi | 13 | ||||
-rwxr-xr-x | httemplate/browse/svc_acct_pop.cgi | 5 |
3 files changed, 35 insertions, 8 deletions
diff --git a/httemplate/browse/addr_block.cgi b/httemplate/browse/addr_block.cgi index d597ee17e..917f94c96 100644 --- a/httemplate/browse/addr_block.cgi +++ b/httemplate/browse/addr_block.cgi @@ -2,13 +2,13 @@ 'title' => 'Address Blocks', 'name' => 'address block', 'html_init' => $html_init, - 'html_form' => $html_form, + 'html_foot' => $html_foot, 'query' => { 'table' => 'addr_block', 'hashref' => {}, 'extra_sql' => $extra_sql, 'order_by' => $order_by, }, - 'count_query' => "SELECT count(*) from addr_block $extra_sql", + 'count_query' => "SELECT count(*) from addr_block $count_sql", 'header' => [ 'Address Block', 'Router', 'Action(s)', @@ -42,17 +42,26 @@ 'border-right:none;', 'border-left:none;', ], + 'agent_virt' => 1, + 'agent_null_right' => 'Engineering global configuration', + 'agent_pos' => 1, ) %> <%init> die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + unless $FS::CurrentUser::CurrentUser->access_right('Engineering configuration') + || $FS::CurrentUser::CurrentUser->access_right('Engineering global configuration'); my $p2 = popurl(2); my $path = $p2 . "edit/process/addr_block"; -my $extra_sql = " "; +my $extra_sql = ""; + +my $count_sql = "WHERE ". $FS::CurrentUser::CurrentUser->agentnums_sql( + 'null_right' => 'Engineering global configuration', +); + my $order_by = "ORDER BY "; $order_by .= "inet(ip_gateway), " if driver_name =~ /^Pg/i; $order_by .= "inet_aton(ip_gateway), " if driver_name =~ /^mysql/i; @@ -74,10 +83,16 @@ my $confirm = sub { "javascript:addr_block_areyousure('$path/$verb.cgi?blocknum=$num', '$verb')"; }; -my $html_form = qq( +my $html_foot = qq( <FORM ACTION="$path/add.cgi" METHOD="POST"> Gateway/Netmask: <INPUT TYPE="text" NAME="ip_gateway" SIZE="15">/<INPUT TYPE="text" NAME="ip_netmask" SIZE="2"> +); +$html_foot .= include( '/elements/select-agent.html', + 'agent_virt' => 1, + 'agent_null_right' => 'Engineering global configuration', + ); +$html_foot .= qq( <INPUT TYPE="submit" NAME="submit" VALUE="Add"> </FORM> ); diff --git a/httemplate/browse/router.cgi b/httemplate/browse/router.cgi index 9d856f67c..9f7167329 100644 --- a/httemplate/browse/router.cgi +++ b/httemplate/browse/router.cgi @@ -6,7 +6,7 @@ 'hashref' => {}, 'extra_sql' => $extra_sql, }, - 'count_query' => "SELECT count(*) from router $extra_sql", + 'count_query' => "SELECT count(*) from router $count_sql", 'header' => [ 'Router name', 'Address block(s)', ], @@ -19,12 +19,16 @@ 'links' => [ [ "${p2}edit/router.cgi?", 'routernum' ], '', ], + 'agent_virt' => 1, + 'agent_null_right'=> "Engineering global configuration", + 'agent_pos' => 1, ) %> <%init> die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + unless $FS::CurrentUser::CurrentUser->access_right('Engineering configuration') + || $FS::CurrentUser::CurrentUser->access_right('Engineering global configuration'); my $p2 = popurl(2); my $extra_sql = ''; @@ -40,4 +44,9 @@ if ($cgi->param('hidecustomerrouters') eq '1') { push @menubar, 'Hide customer routers', $cgi->self_url(); } +my $count_sql = $extra_sql. ( $extra_sql =~ /WHERE/ ? ' AND' : 'WHERE' ). + $FS::CurrentUser::CurrentUser->agentnums_sql( + 'null_right' => 'Engineering global configuration', + ); + </%init> diff --git a/httemplate/browse/svc_acct_pop.cgi b/httemplate/browse/svc_acct_pop.cgi index 44bc651cf..4e493717a 100755 --- a/httemplate/browse/svc_acct_pop.cgi +++ b/httemplate/browse/svc_acct_pop.cgi @@ -27,8 +27,11 @@ %> <%init> +my $curuser = $FS::CurrentUser::CurrentUser; + die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + unless $curuser->access_right('Engineering configuration') + || $curuser->access_right('Engineering global configuration'); my $html_init = qq! <A HREF="${p}edit/svc_acct_pop.cgi"><I>Add new Access Number</I></A> |