1 <% &ntable("#cccccc") %><TR><TD><% &ntable("#cccccc",2) %>
3 <& /view/elements/tr.html, label=>mt('Service'), value=>$part_svc->svc &>
4 <& /view/elements/tr.html, label=>mt('Username'), value=>$svc_acct->username &>
5 <& /view/elements/tr.html, label=>mt('Domain'), value=>$domain &>
7 % if ( $opt{'communigate'} ) {
8 <& /view/elements/tr.html, label=>mt('Aliases'), value=>$svc_acct->cgp_aliases &>
11 % if ( $svc_acct->pbxsvc ) {
12 <& /view/elements/tr.html, label=>mt('PBX'), value=>$svc_acct->pbx_title &>
16 % my $password = $svc_acct->get_cleartext_password;
17 % if ( $password =~ /^\*\w+\* (.*)$/ ) {
19 % $show_pw .= '<I>('. mt('login disabled') .')</I> ';
22 % && $svc_acct->_password_encryption ne 'plain'
23 % && $svc_acct->_password
26 % $show_pw .= '<I>('. uc($svc_acct->_password_encryption). ' '.mt('encrypted').')</I>';
27 % } elsif ( $conf->exists('showpasswords') ) {
28 % $show_pw .= '<PRE>'. encode_entities($password). '</PRE>';
30 % $show_pw .= '<I>('. mt('hidden') .')</I>';
33 <& /view/elements/tr.html, label=>mt('Password'), value=>$show_pw &>
36 % if ( $conf->exists('security_phrase') ) {
37 <& /view/elements/tr.html, label=>mt('Security phrase'), value=>$svc_acct->sec_phrase &>
40 % if ( $svc_acct->popnum ) {
41 % my $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum});
42 <& /view/elements/tr.html, label=>mt('Access number'), value=>$svc_acct_pop->text &>
45 % if ($svc_acct->uid ne '') {
46 <& /view/elements/tr.html, label=>mt('UID'), value=>$svc_acct->uid &>
49 % if ($svc_acct->gid ne '') {
50 <& /view/elements/tr.html, label=>mt('GID'), value=>$svc_acct->gid &>
53 % if ($svc_acct->finger ne '') {
54 <& /view/elements/tr.html, label=>mt('Real Name'), value=>$svc_acct->finger &>
57 % if ($svc_acct->dir ne '') {
58 <& /view/elements/tr.html, label=>mt('Home directory'), value=>$svc_acct->dir &>
61 % if ($svc_acct->shell ne '') {
62 <& /view/elements/tr.html, label=>mt('Shell'), value=>$svc_acct->shell &>
65 % if ($svc_acct->quota ne '' && ! $opt{'communigate'} ) {
67 <& /view/elements/tr.html, label=>mt('Quota'), value=>$svc_acct->quota &>
69 % } elsif ( $opt{'communigate'} ) {
71 <& communigate.html, %opt &>
75 % if ($svc_acct->slipip) {
76 <& /view/elements/tr.html,
77 label=>mt('IP address'),
78 value=> ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' )
79 ? "<I>(".mt('Dynamic').")</I>"
84 <& usage.html, 'svc_acct' => $svc_acct &>
86 % foreach my $attribute ( grep /^radius_/, $svc_acct->fields ) {
87 % $attribute =~ /^radius_(.*)$/;
88 % my $pattribute = $FS::raddb::attrib{$1};
89 <& /view/elements/tr.html, label=>mt("Radius (reply) [_1]",$pattribute),
90 value=>$svc_acct->getfield($attribute)
94 % foreach my $attribute ( grep /^rc_/, $svc_acct->fields ) {
95 % $attribute =~ /^rc_(.*)$/;
96 % my $pattribute = $FS::raddb::attrib{$1};
97 <& /view/elements/tr.html, label=>mt("Radius (check) [_1]",$pattribute),
98 value=>$svc_acct->getfield($attribute)
102 <& /view/elements/tr.html, label=>mt('RADIUS groups'),
103 value=>join('<BR>', $svc_acct->radius_groups('COMBINED')) &>
105 %# Can this be abstracted further? Maybe a library function like
106 %# widget('HTML', 'view', $svc_acct) ? It would definitely make UI
107 %# style management easier.
108 % foreach (sort { $a cmp $b } $svc_acct->virtual_fields) {
109 <% $svc_acct->pvf($_)->widget('HTML', 'view', $svc_acct->getfield($_)) %>
112 </TABLE></TD></TR></TABLE>
117 my $conf = new FS::Conf;
119 my $svc_acct = $opt{'svc_acct'};
120 my $part_svc = $opt{'part_svc'};
122 die 'Empty domsvc for svc_acct.svcnum '. $svc_acct->svcnum
123 unless $svc_acct->domsvc;
124 my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $svc_acct->domsvc } );
125 die 'Unknown domain (domsvc '. $svc_acct->domsvc.
126 ' for svc_acct.svcnum '. $svc_acct->svcnum. ')'
128 my $domain = $svc_domain->domain;