X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_acct.cgi;h=7be5eabb7531e70dfd667aae986dcf8d242a8238;hp=574fb51ebd70a427803193a0787d205414356bcf;hb=ac8410cdb67639afeb84c84e975fffadf3e6cce1;hpb=9d35792778885932c09102bd011b518eb47c5131 diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi index 574fb51eb..7be5eabb7 100755 --- a/httemplate/edit/svc_acct.cgi +++ b/httemplate/edit/svc_acct.cgi @@ -30,8 +30,9 @@ <% $part_svc->svc %> - - <% mt('Username') |h %> +<% include('/elements/tr-td-label.html', + 'label' => $part_svc->part_svc_column('username')->columnlabel || mt('Username'), + 'required' => $part_svc->part_svc_column('username')->required ) %> % if ( $svcnum && $conf->exists('svc_acct-no_edit_username') ) { <% $svc_acct->username() %> @@ -43,12 +44,18 @@ %if ( $part_svc->part_svc_column('_password')->columnflag ne 'F' ) { - % #XXX eventually should require "Edit Password" ACL - <% mt('Password') |h %> +<% include('/elements/tr-td-label.html', + 'label' => $part_svc->part_svc_column('_password')->columnlabel || mt('Password'), + 'required' => $part_svc->part_svc_column('_password')->required ) %> MAXLENGTH=<% $pmax %>> - <& /elements/random_pass.html, 'clear_password' &> + <& /elements/random_pass.html, 'clear_password' &>
+
+ <& '/elements/validate_password.html', + 'fieldid' => 'clear_password', + 'svcnum' => $svcnum + &> %}else{ @@ -60,8 +67,9 @@ %if ( $conf->exists('security_phrase') % && $part_svc->part_svc_column('sec_phrase')->columnflag ne 'F' ) { - - <% mt('Security phrase') |h %> +<% include('/elements/tr-td-label.html', + 'label' => $part_svc->part_svc_column('sec_phrase')->columnlabel || mt('Security phrase'), + 'required' => $part_svc->part_svc_column('sec_phrase')->required ) %> (<% mt('for forgotten passwords') |h %>) @@ -97,8 +105,9 @@ % ) % ); - - <% mt('Domain') |h %> +<% include('/elements/tr-td-label.html', + 'label' => $part_svc->part_svc_column('domsvc')->columnlabel || mt('Domain'), + 'required' => $part_svc->part_svc_column('domsvc')->required ) %> % } else { - - <% mt('Access number') |h %> +<% include('/elements/tr-td-label.html', + 'label' => $part_svc->part_svc_column('popnum')->columnlabel || mt('Access number'), + 'required' => $part_svc->part_svc_column('popnum')->required ) %> <% FS::svc_acct_pop::popselector($popnum) %> % } @@ -156,6 +167,8 @@ 'curr_value' => $svc_acct->sectornum, #'part_svc' => $part_svc, #'cust_pkg' => $cust_pkg, + 'required' => $part_svc->part_svc_column('sectornum')->required, + 'label' => $part_svc->part_svc_column('sectornum')->columnlabel || mt('Tower sector'), &> %} else { @@ -176,8 +189,11 @@ % % if ( length($svc_acct->$xid()) ) { - - <% uc($xid) %> +<% include('/elements/tr-td-label.html', + 'label' => $part_svc->part_svc_column($xid)->columnlabel || uc($xid), + 'required' => $part_svc->part_svc_column($xid)->required ) %> +%# +%# <% uc($xid) %> <% $svc_acct->$xid() %> @@ -187,8 +203,9 @@ % } else { - - <% uc($xid) %> +<% include('/elements/tr-td-label.html', + 'label' => $part_svc->part_svc_column($xid)->columnlabel || uc($xid), + 'required' => $part_svc->part_svc_column($xid)->required ) %> @@ -205,8 +222,9 @@ % } else { - - <% mt('Real Name') |h %> +<% include('/elements/tr-td-label.html', + 'label' => $part_svc->part_svc_column('finger')->columnlabel || mt('Real Name'), + 'required' => $part_svc->part_svc_column('finger')->required ) %> @@ -223,8 +241,9 @@ % } else { - - <% mt('Home directory') |h %> +<% include('/elements/tr-td-label.html', + 'label' => $part_svc->part_svc_column('dir')->columnlabel || mt('Home directory'), + 'required' => $part_svc->part_svc_column('dir')->required ) %> % } @@ -240,8 +259,9 @@ % } else { - - <% mt('Shell') |h %> +<% include('/elements/tr-td-label.html', + 'label' => $part_svc->part_svc_column('shell')->columnlabel || mt('Shell'), + 'required' => $part_svc->part_svc_column('shell')->required ) %> % } else { - - <% mt('IP') |h %> +<% include('/elements/tr-td-label.html', + 'label' => $part_svc->part_svc_column('slipip')->columnlabel || mt('IP'), + 'required' => $part_svc->part_svc_column('slipip')->required ) %> % } @@ -324,8 +349,9 @@ % } - - <% mt('RADIUS groups') |h %> +<% include('/elements/tr-td-label.html', + 'label' => $part_svc->part_svc_column('usergroup')->columnlabel || mt('RADIUS groups'), + 'required' => $part_svc->part_svc_column('usergroup')->required ) %> % if ( $part_svc_usergroup->columnflag eq 'F' ) { <% join('
', @groupnames) %> % } else { @@ -345,6 +371,35 @@ % } + +% 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' ) { @@ -502,7 +557,7 @@ my $ulen = : dbdef->table('svc_acct')->column('username')->length; my $ulen2 = $ulen+2; -my $pmax = max($conf->config('passwordmax') || 13); +my $pmax = max($conf->config('passwordmax') || 12); my $pmax2 = $pmax+2; my $p1 = popurl(1); @@ -525,4 +580,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); + } + } +} +