-my $svc_acct_pop = $svc_acct->popnum
- ? qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum})
- : '';
-print "<TR><TD ALIGN=\"right\">Access number</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct_pop->text. '</TD></TR>'
- if $svc_acct_pop;
-
-if ($svc_acct->uid ne '') {
- print "<TR><TD ALIGN=\"right\">Uid</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->uid. "</TD></TR>",
- "<TR><TD ALIGN=\"right\">Gid</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->gid. "</TD></TR>",
- "<TR><TD ALIGN=\"right\">GECOS</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->finger. "</TD></TR>",
- "<TR><TD ALIGN=\"right\">Home directory</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->dir. "</TD></TR>",
- "<TR><TD ALIGN=\"right\">Shell</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->shell. "</TD></TR>",
- "<TR><TD ALIGN=\"right\">Quota</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->quota. "</TD></TR>"
- ;
-} else {
- print "<TR><TH COLSPAN=2>(No shell account)</TH></TR>";
-}
+% }
+
+
+<% &ntable("#cccccc") %><TR><TD><% &ntable("#cccccc",2) %>
+
+<TR>
+ <TD ALIGN="right">Service</TD>
+ <TD BGCOLOR="#ffffff"><% $part_svc->svc %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Username</TD>
+ <TD BGCOLOR="#ffffff"><% $svc_acct->username %></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Domain</TD>
+ <TD BGCOLOR="#ffffff"><% $domain %></TD>
+</TR>
+
+<TR>
+ <TD ALIGN="right">Password</TD>
+ <TD BGCOLOR="#ffffff">
+% my $password = $svc_acct->_password;
+% if ( $password =~ /^\*\w+\* (.*)$/ ) {
+% $password = $1;
+%
+
+ <I>(login disabled)</I>
+% }
+% if ( $conf->exists('showpasswords') ) {
+
+ <PRE><% encode_entities($password) %></PRE>
+% } else {
+
+ <I>(hidden)</I>
+% }
+
+
+ </TD>
+</TR>
+% $password = '';
+% if ( $conf->exists('security_phrase') ) {
+% my $sec_phrase = $svc_acct->sec_phrase;
+%
+
+ <TR>
+ <TD ALIGN="right">Security phrase</TD>
+ <TD BGCOLOR="#ffffff"><% $svc_acct->sec_phrase %></TD>
+ </TR>
+% }
+% if ( $svc_acct->popnum ) {
+% my $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum});
+%
+
+ <TR>
+ <TD ALIGN="right">Access number</TD>
+ <TD BGCOLOR="#ffffff"><% $svc_acct_pop->text %></TD>
+ </TR>
+% }
+% if ($svc_acct->uid ne '') {
+
+ <TR>
+ <TD ALIGN="right">UID</TD>
+ <TD BGCOLOR="#ffffff"><% $svc_acct->uid %></TD>
+ </TR>
+% }
+% if ($svc_acct->gid ne '') {
+
+ <TR>
+ <TD ALIGN="right">GID</TD>
+ <TD BGCOLOR="#ffffff"><% $svc_acct->gid %></TD>
+ </TR>
+% }
+% if ($svc_acct->finger ne '') {
+
+ <TR>
+ <TD ALIGN="right">GECOS</TD>
+ <TD BGCOLOR="#ffffff"><% $svc_acct->finger %></TD>
+ </TR>
+% }
+% if ($svc_acct->dir ne '') {
+
+ <TR>
+ <TD ALIGN="right">Home directory</TD>
+ <TD BGCOLOR="#ffffff"><% $svc_acct->dir %></TD>
+ </TR>
+% }
+% if ($svc_acct->shell ne '') {
+
+ <TR>
+ <TD ALIGN="right">Shell</TD>
+ <TD BGCOLOR="#ffffff"><% $svc_acct->shell %></TD>
+ </TR>
+% }
+% if ($svc_acct->quota ne '') {
+
+ <TR>
+ <TD ALIGN="right">Quota</TD>
+ <TD BGCOLOR="#ffffff"><% $svc_acct->quota %></TD>
+ </TR>
+% }
+% if ($svc_acct->slipip) {
+
+ <TR>
+ <TD ALIGN="right">IP address</TD>
+ <TD BGCOLOR="#ffffff">
+ <% ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' )
+ ? "<I>(Dynamic)</I>"
+ : $svc_acct->slipip
+ %>
+ </TD>
+ </TR>
+% }
+% my %ulabel = ( seconds => 'Time',
+% upbytes => 'Upload bytes',
+% downbytes => 'Download bytes',
+% totalbytes => 'Total bytes',
+% );
+% foreach my $uf ( keys %ulabel ) {
+% my $tf = $uf . "_threshold";
+% if ( $svc_acct->$uf ne '' ) {
+% my $v = $uf eq 'seconds'
+% #? (($svc_acct->$uf < 0 ? '-' : ''). duration_exact($svc_acct->$uf) )
+% ? ($svc_acct->$uf < 0 ? '-' : '').
+% int(abs($svc_acct->$uf)/3600). "hr ".
+% sprintf("%02d",(abs($svc_acct->$uf)%3600)/60). "min"
+% : FS::UI::bytecount::display_bytecount($svc_acct->$uf);
+ <TR>
+ <TD ALIGN="right"><% $ulabel{$uf} %> remaining</TD>
+ <TD BGCOLOR="#ffffff"><% $v %></TD>
+ </TR>
+
+% }
+% }
+% foreach my $attribute ( grep /^radius_/, $svc_acct->fields ) {
+% $attribute =~ /^radius_(.*)$/;
+% my $pattribute = $FS::raddb::attrib{$1};
+%
+
+ <TR>
+ <TD ALIGN="right">Radius (reply) <% $pattribute %></TD>
+ <TD BGCOLOR="#ffffff"><% $svc_acct->getfield($attribute) %></TD>
+ </TR>
+% }
+% foreach my $attribute ( grep /^rc_/, $svc_acct->fields ) {
+% $attribute =~ /^rc_(.*)$/;
+% my $pattribute = $FS::raddb::attrib{$1};
+%
+
+ <TR>
+ <TD ALIGN="right">Radius (check) <% $pattribute %></TD>
+ <TD BGCOLOR="#ffffff"><% $svc_acct->getfield($attribute) %></TD>
+ </TR>
+% }
+
+
+<TR>
+ <TD ALIGN="right">RADIUS groups</TD>
+ <TD BGCOLOR="#ffffff"><% join('<BR>', $svc_acct->radius_groups) %></TD>
+</TR>
+%
+%# Can this be abstracted further? Maybe a library function like
+%# widget('HTML', 'view', $svc_acct) ? It would definitely make UI
+%# style management easier.
+%
+% foreach (sort { $a cmp $b } $svc_acct->virtual_fields) {
+
+ <% $svc_acct->pvf($_)->widget('HTML', 'view', $svc_acct->getfield($_)) %>
+% }
+
+
+</TABLE></TD></TR></TABLE>
+</FORM>
+<BR><BR>
+
+% if ( @svc_www ) {
+ Hosting
+ <% &ntable("#cccccc") %><TR><TD><% &ntable("#cccccc",2) %>
+% foreach my $svc_www (@svc_www) {
+% my($label, $value) = $svc_www->cust_svc->label;
+% my $link = $p. 'view/svc_www.cgi?'. $svc_www->svcnum;
+ <TR>
+ <TD BGCOLOR="#ffffff">
+ <A HREF="<% $link %>"><% "$label: $value" %></A>
+ </TD>
+ </TR>
+% }
+ </TABLE></TD></TR></TABLE>
+ <BR><BR>
+% }
+
+<% join("<BR>", $conf->config('svc_acct-notes') ) %>
+<BR><BR>
+
+<% joblisting({'svcnum'=>$svcnum}, 1) %>
+
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('View customer services');