$svcnum<\/B>/;
<% $svclabel %>
% } else {
<% mt("Service # (NEW)") |h %>
% }
<% ntable("#cccccc",2) %>
<% mt('Service') |h %> |
<% $part_svc->svc %> |
<% mt('Username') |h %> |
% if ( $svcnum && $conf->exists('svc_acct-no_edit_username') ) {
<% $svc_acct->username() %> |
% } else {
MAXLENGTH=<% $ulen %>>
|
% }
%if ( $part_svc->part_svc_column('_password')->columnflag ne 'F' ) {
% #XXX eventually should require "Edit Password" ACL
<% mt('Password') |h %> |
MAXLENGTH=<% $pmax %>>
<& /elements/random_pass.html, 'clear_password' &>
|
%}else{
%}
%
%my $sec_phrase = $svc_acct->sec_phrase;
%if ( $conf->exists('security_phrase')
% && $part_svc->part_svc_column('sec_phrase')->columnflag ne 'F' ) {
<% mt('Security phrase') |h %> |
(<% mt('for forgotten passwords') |h %>)
|
% } else {
% }
%
%#domain
%my $domsvc = $svc_acct->domsvc || 0;
%if ( $part_svc->part_svc_column('domsvc')->columnflag eq 'F' ) {
%
% } else {
%
% my %svc_domain = ();
%
% if ( $domsvc ) {
% my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $domsvc, } );
% if ( $svc_domain ) {
% $svc_domain{$svc_domain->svcnum} = $svc_domain->domain;
% } else {
% warn "unknown svc_domain.svcnum for svc_acct.domsvc: $domsvc";
% }
% }
%
% %svc_domain = (%svc_domain,
% domain_select_hash FS::svc_acct('svcpart' => $svcpart,
% 'pkgnum' => $pkgnum,
% )
% );
<% mt('Domain') |h %> |
|
% }
% if ( $communigate ) {
<% mt('Aliases') |h %> |
|
% } else {
% }
<& /elements/tr-select-svc_pbx.html,
'curr_value' => $svc_acct->pbxsvc,
'part_svc' => $part_svc,
'cust_pkg' => $cust_pkg,
&>
%#pop
%my $popnum = $svc_acct->popnum || 0;
%if ( $part_svc->part_svc_column('popnum')->columnflag eq 'F' ) {
%
% } else {
<% mt('Access number') |h %> |
<% FS::svc_acct_pop::popselector($popnum) %> |
% }
%#tower (huh)
%if ( $conf->exists('svc_acct-tower_sector')
% && $part_svc->part_svc_column('sectornum')->columnflag ne 'F' ) {
<& /elements/tr-select-tower_sector.html,
'curr_value' => $svc_acct->sectornum,
#'part_svc' => $part_svc,
#'cust_pkg' => $cust_pkg,
&>
%} else {
%}
<& /elements/tr-svc_export_machine.html,
'svc' => $svc_acct,
'part_svc' => $part_svc,
'cgi' => $cgi,
&>
% #uid/gid
% foreach my $xid (qw( uid gid )) {
%
% if ( $part_svc->part_svc_column($xid)->columnflag =~ /^[FA]$/
% || ! $conf->exists("svc_acct-edit_$xid")
% ) {
%
% if ( length($svc_acct->$xid()) ) {
<% uc($xid) %> |
<% $svc_acct->$xid() %> |
|
% }
% } else {
<% uc($xid) %> |
|
% }
% }
%
%#finger
%if ( $part_svc->part_svc_column('uid')->columnflag eq 'F'
% && ! $svc_acct->finger ) {
%
% } else {
<% mt('Real Name') |h %> |
|
% }
%
%#dir
%if ( $part_svc->part_svc_column('dir')->columnflag eq 'F'
% || !$curuser->access_right('Edit home dir')
% ) {
% } else {
<% mt('Home directory') |h %> |
|
% }
%
%#shell
%my $shell = $svc_acct->shell;
%if ( $part_svc->part_svc_column('shell')->columnflag eq 'F'
% || ( !$shell && $part_svc->part_svc_column('uid')->columnflag eq 'F' )
% ) {
%
% } else {
<% mt('Shell') |h %> |
|
% }
<& svc_acct/communigate.html,
'svc_acct' => $svc_acct,
'part_svc' => $part_svc,
'communigate' => $communigate,
&>
% if ( $conf->exists('svc_acct-ip_addr') ) {
% # router/block selection UI
% # (should we show this if slipip is fixed?)
<& /elements/tr-select-router_block_ip.html,
'object' => $svc_acct,
'ip_field' => 'slipip'
&>
% } else {
% # don't expose these to the user--they're only useful in the other case
% if ( $part_svc->part_svc_column('slipip')->columnflag =~ /^[FA]$/ ) {
% } else {
<% mt('IP') |h %> |
|
% }
% }
% my %label = ( seconds => 'Time',
% upbytes => 'Upload bytes',
% downbytes => 'Download bytes',
% totalbytes => 'Total bytes',
% );
% foreach my $uf (keys %label) {
% my $tf = $uf . "_threshold";
% if ( $curuser->access_right('Edit usage') ) {
<% mt("[_1] remaining",$label{$uf}) |h %> |
(<% mt('blank disables') |h %>) |
<% mt("[_1] threshold",$label{$uf}) |h %> |
(<% mt('blank disables') |h %>) |
% }else{
% }
% }
%
%foreach my $r ( grep { /^r(adius|[cr])_/ } fields('svc_acct') ) {
% $r =~ /^^r(adius|[cr])_(.+)$/ or next; #?
% my $a = $2;
%
% if ( $part_svc->part_svc_column($r)->columnflag =~ /^[FA]$/ ) {
% } else {
<% $FS::raddb::attrib{$a} %> |
|
% }
% }
<% mt('RADIUS groups') |h %> |
% if ( $part_svc_usergroup->columnflag eq 'F' ) {
<% join(' ', @groupnames) %> |
% } else {
% my $radius_group_selected = '';
% if ( $svc_acct->svcnum ) {
% $radius_group_selected = join(',',$svc_acct->radius_groups('groupnum'));
% }
% elsif ( !$svc_acct->svcnum && $part_svc_usergroup->columnflag eq 'D' ) {
% $radius_group_selected = $part_svc_usergroup->columnvalue;
% }
<& /elements/select-radius_group.html,
curr_value => $radius_group_selected,
element_name => 'radius_usergroup',
multiple => 1,
&>
|
% }
% 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' ) {
<% $svc_acct->pvf($field)->widget('HTML', 'edit', $svc_acct->getfield($field)) %>
% }
% }
% if ( $captcha_url ) {
<% mt('Enter the word shown above:') |h %>
% }