@@ -204,54 +204,90 @@ print "Access number ".
"". $svc_acct_pop->text. ' '
if $svc_acct_pop;
-if ($svc_acct->uid ne '') {
- print "Uid ".
- "". $svc_acct->uid. " ",
- "Gid ".
- "". $svc_acct->gid. " ",
- "GECOS ".
- "". $svc_acct->finger. " ",
- "Home directory ".
- "". $svc_acct->dir. " ",
- "Shell ".
- "". $svc_acct->shell. " ",
- "Quota ".
- "". $svc_acct->quota. " "
- ;
-} else {
- print "(No shell account) ";
-}
+%>
-if ($svc_acct->slipip) {
- print "IP address ".
- ( ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' )
- ? "(Dynamic) "
- : $svc_acct->slipip
- ). " ";
- my($attribute);
- foreach $attribute ( grep /^radius_/, $svc_acct->fields ) {
- #warn $attribute;
- $attribute =~ /^radius_(.*)$/;
- my $pattribute = $FS::raddb::attrib{$1};
- print "Radius (reply) $pattribute ".
- "". $svc_acct->getfield($attribute).
- " ";
- }
- foreach $attribute ( grep /^rc_/, $svc_acct->fields ) {
- #warn $attribute;
- $attribute =~ /^rc_(.*)$/;
- my $pattribute = $FS::raddb::attrib{$1};
- print "Radius (check) $pattribute: ".
- "". $svc_acct->getfield($attribute).
- " ";
- }
-} else {
- print "(No SLIP/PPP account) ";
+<% if ($svc_acct->uid ne '') { %>
+
+ UID
+ <%= $svc_acct->uid %>
+
+<% } %>
+
+<% if ($svc_acct->gid ne '') { %>
+
+ GID
+ <%= $svc_acct->gid %>
+
+<% } %>
+
+<% if ($svc_acct->finger ne '') { %>
+
+ GECOS
+ <%= $svc_acct->finger %>
+
+<% } %>
+
+<% if ($svc_acct->dir ne '') { %>
+
+ Home directory
+ <%= $svc_acct->dir %>
+
+<% } %>
+
+<% if ($svc_acct->shell ne '') { %>
+
+ Shell
+ <%= $svc_acct->shell %>
+
+<% } %>
+
+<% if ($svc_acct->quota ne '') { %>
+
+ Quota
+ <%= $svc_acct->quota %>
+
+<% } %>
+
+<% if ($svc_acct->slipip) { %>
+
+ IP address
+
+ <%= ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' )
+ ? "(Dynamic) "
+ : $svc_acct->slipip
+ %>
+
+
+<% } %>
+
+<%
+
+my($attribute);
+foreach $attribute ( grep /^radius_/, $svc_acct->fields ) {
+ #warn $attribute;
+ $attribute =~ /^radius_(.*)$/;
+ my $pattribute = $FS::raddb::attrib{$1};
+ print "Radius (reply) $pattribute ".
+ "". $svc_acct->getfield($attribute).
+ " ";
+}
+foreach $attribute ( grep /^rc_/, $svc_acct->fields ) {
+ #warn $attribute;
+ $attribute =~ /^rc_(.*)$/;
+ my $pattribute = $FS::raddb::attrib{$1};
+ print "Radius (check) $pattribute: ".
+ "". $svc_acct->getfield($attribute).
+ " ";
}
print 'RADIUS groups '.
join(' ', $svc_acct->radius_groups). ' ';
+if ( $svc_acct->seconds =~ /^\d+$/ ) {
+ print 'Prepaid time '.
+ duration_exact($svc_acct->seconds). ' ';
+}
+
# Can this be abstracted further? Maybe a library function like
# widget('HTML', 'view', $svc_acct) ? It would definitely make UI
# style management easier.