3 # $Id: svc_acct.cgi,v 1.8 1999-02-28 00:04:02 ivan Exp $
5 # Usage: svc_acct.cgi svcnum
6 # http://server.name/path/svc_acct.cgi?svcnum
8 # ivan@voicenet.com 96-dec-17
10 # added link to send info
11 # ivan@voicenet.com 97-jan-4
13 # added navigation bar and ability to change username, etc.
14 # ivan@voicenet.com 97-jan-30
16 # activate 800 service
17 # ivan@voicenet.com 97-feb-10
19 # modified navbar code (should be a subroutine?), added link to cancel account (only if not audited)
20 # ivan@voicenet.com 97-apr-16
22 # INCOMPLETELY rewrote some things for new API
23 # ivan@voicenet.com 97-jul-29
25 # FS::Search became FS::Record, use strict, etc. ivan@sisd.com 98-mar-9
27 # Changes to allow page to work at a relative position in server
28 # Changed 'password' to '_password' because Pg6.3 reserves the password word
29 # bmccane@maxbaud.net 98-apr-3
31 # /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-17
33 # displays arbitrary radius attributes ivan@sisd.com 98-aug-16
35 # $Log: svc_acct.cgi,v $
36 # Revision 1.8 1999-02-28 00:04:02 ivan
37 # removed misleading comments
39 # Revision 1.7 1999/01/19 05:14:21 ivan
40 # for mod_perl: no more top-level my() variables; use vars instead
41 # also the last s/create/new/;
43 # Revision 1.6 1999/01/18 09:41:45 ivan
44 # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
47 # Revision 1.5 1999/01/18 09:22:36 ivan
48 # changes to track email addresses for email invoicing
50 # Revision 1.4 1998/12/23 03:09:19 ivan
51 # $cgi->keywords instead of $cgi->query_string
53 # Revision 1.3 1998/12/17 09:57:23 ivan
54 # s/CGI::(Base|Request)/CGI.pm/;
56 # Revision 1.2 1998/12/16 05:24:29 ivan
61 use vars qw( $conf $cgi $mydomain $query $svcnum $svc_acct $cust_svc $pkgnum
62 $cust_pkg $custnum $part_svc $p $svc_acct_pop );
64 use CGI::Carp qw( fatalsToBrowser );
65 use FS::UID qw( cgisuidsetup );
66 use FS::CGI qw( header popurl );
67 use FS::Record qw( qsearchs fields );
79 $mydomain = $conf->config('domain');
82 ($query) = $cgi->keywords;
85 $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
86 die "Unkonwn svcnum" unless $svc_acct;
88 $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
89 $pkgnum = $cust_svc->getfield('pkgnum');
91 $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
92 $custnum=$cust_pkg->getfield('custnum');
95 $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } );
96 die "Unkonwn svcpart" unless $part_svc;
98 print $cgi->header( '-expires' => 'now' ), header('Account View', '');
101 if ($pkgnum || $custnum) {
103 <A HREF="${p}view/cust_pkg.cgi?$pkgnum">View this package (#$pkgnum)</A> |
104 <A HREF="${p}view/cust_main.cgi?$custnum">View this customer (#$custnum)</A> |
108 <A HREF="${p}misc/cancel-unaudited.cgi?$svcnum">Cancel this (unaudited)account</A> |
113 <A HREF="${p}">Main menu</A></CENTER><BR>
114 <FONT SIZE=+1>Service #$svcnum</FONT>
117 print qq!<BR><A HREF="${p}edit/svc_acct.cgi?$svcnum">Edit this information</A>!;
118 #print qq!<BR><A HREF="../misc/sendconfig.cgi?$svcnum">Send account information</A>!;
119 print qq!<BR><BR><A HREF="#general">General</A> | <A HREF="#shell">Shell account</A> | !;
120 print qq!<A HREF="#slip">SLIP/PPP account</A></CENTER>!;
123 print qq!<HR><CENTER><FONT SIZE=+1><A NAME="general">General</A></FONT></CENTER>!;
126 print "Service: <B>", $part_svc->svc, "</B>";
129 print "<BR>Username: <B>", $svc_acct->username, "</B>";
132 if (substr($svc_acct->_password,0,1) eq "*") {
133 print "<BR>Password: <I>(Login disabled)</I><BR>";
135 print "<BR>Password: <I>(hidden)</I><BR>";
138 # popnum -> svc_acct_pop record
139 $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum});
142 print "POP: <B>", $svc_acct_pop->city, ", ", $svc_acct_pop->state,
143 " (", $svc_acct_pop->ac, ")/", $svc_acct_pop->exch, "<\B>"
147 print qq!<HR><CENTER><FONT SIZE=+1><A NAME="shell">!;
148 if ($svc_acct->uid ne '') {
149 print "Shell account";
150 print "</A></FONT></CENTER>";
151 print "Uid: <B>", $svc_acct->uid, "</B>";
152 print "<BR>Gid: <B>", $svc_acct->gid, "</B>";
154 print qq!<BR>Finger name: <B>!, $svc_acct->finger, qq!</B><BR>!;
156 print "Home directory: <B>", $svc_acct->dir, "</B><BR>";
158 print "Shell: <B>", $svc_acct->shell, "</B><BR>";
160 print "Quota: <B>", $svc_acct->quota, "</B> <I>(unimplemented)</I>";
162 print "No shell account.</A></FONT></CENTER>";
166 print qq!<HR><CENTER><FONT SIZE=+1><A NAME="slip">!;
167 if ($svc_acct->slipip) {
168 print "SLIP/PPP account</A></FONT></CENTER>";
169 print "IP address: <B>", ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' ) ? "<I>(Dynamic)</I>" : $svc_acct->slipip ,"</B>";
171 foreach $attribute ( grep /^radius_/, fields('svc_acct') ) {
173 $attribute =~ /^radius_(.*)$/;
174 my($pattribute) = ($1);
175 $pattribute =~ s/_/-/g;
176 print "<BR>Radius $pattribute: <B>". $svc_acct->getfield($attribute), "</B>";
179 print "No SLIP/PPP account</A></FONT></CENTER>"