From e1eb06c05b654a4533bab0e034e87a8de99015cc Mon Sep 17 00:00:00 2001 From: cvs2git Date: Mon, 12 Oct 1998 07:03:12 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'freeside_current'. --- htdocs/view/cust_bill.cgi | 79 ----------- htdocs/view/cust_main.cgi | 336 -------------------------------------------- htdocs/view/cust_pkg.cgi | 181 ------------------------ htdocs/view/svc_acct.cgi | 172 ----------------------- htdocs/view/svc_acct_sm.cgi | 114 --------------- htdocs/view/svc_domain.cgi | 76 ---------- 6 files changed, 958 deletions(-) delete mode 100755 htdocs/view/cust_bill.cgi delete mode 100755 htdocs/view/cust_main.cgi delete mode 100755 htdocs/view/cust_pkg.cgi delete mode 100755 htdocs/view/svc_acct.cgi delete mode 100755 htdocs/view/svc_acct_sm.cgi delete mode 100755 htdocs/view/svc_domain.cgi (limited to 'htdocs/view') diff --git a/htdocs/view/cust_bill.cgi b/htdocs/view/cust_bill.cgi deleted file mode 100755 index 96101d004..000000000 --- a/htdocs/view/cust_bill.cgi +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/perl -Tw -# -# Usage: cust_bill.cgi invnum -# http://server.name/path/cust_bill.cgi?invnum -# -# Note: Should be run setuid freeside as user nobody. -# -# this is a quick & ugly hack which does little more than add some formatting to the ascii output from /dbin/print-invoice -# -# ivan@voicenet.com 96-dec-05 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# now uses Invoice.pm -# ivan@voicenet.com 97-jun-30 -# -# what to do if cust_bill search errors? -# ivan@voicenet.com 97-jul-7 -# -# s/FS::Search/FS::Record/; $cgisuidsetup($cgi); ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# also print 'printed' field ivan@sisd.com 98-jul-10 - -use strict; -use IO::File; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); -use FS::Invoice; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint invnum -$QUERY_STRING =~ /^(\d+)$/; -my($invnum)=$1; - -my($cust_bill) = qsearchs('cust_bill',{'invnum'=>$invnum}); -die "Invoice #$invnum not found!" unless $cust_bill; -my($custnum) = $cust_bill->getfield('custnum'); - -my($printed) = $cust_bill->printed; - -SendHeaders(); # one guess. -print < - - Invoice View - - -
-

Invoice View

- View this customer (#$custnum) | Main menu -

- -
- Enter payments (check/cash) against this invoice -
Reprint this invoice -

(Printed $printed times) -
-
-END
-
-bless($cust_bill,"FS::Invoice");
-print $cust_bill->print_text;
-
-	#formatting
-	print <
-  
-
-END
-
diff --git a/htdocs/view/cust_main.cgi b/htdocs/view/cust_main.cgi
deleted file mode 100755
index ca5fcd94f..000000000
--- a/htdocs/view/cust_main.cgi
+++ /dev/null
@@ -1,336 +0,0 @@
-#!/usr/bin/perl -Tw
-#
-# cust_main.cgi: View a customer
-#
-# Usage: cust_main.cgi custnum
-#        http://server.name/path/cust_main.cgi?custnum
-#
-# Note: Should be run setuid freeside as user nobody.
-#
-# the payment history section could use some work, see below
-# 
-# ivan@voicenet.com 96-nov-29 -> 96-dec-11
-#
-# added navigation bar (go to main menu ;)
-# ivan@voicenet.com 97-jan-30
-#
-# changes to the way credits/payments are applied (the links are here).
-# ivan@voicenet.com 97-apr-21
-#
-# added debugging code to diagnose CPU sucking problem.
-# ivan@voicenet.com 97-may-19
-#
-# CPU sucking problem was in comment code?  fixed?
-# ivan@voicenet.com 97-may-22
-#
-# rewrote for new API
-# ivan@voicenet.com 97-jul-22
-#
-# Changes to allow page to work at a relative position in server
-# Changed 'day' to 'daytime' because Pg6.3 reserves the day word
-#       bmccane@maxbaud.net     98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-
-use strict;
-use CGI::Base qw(:DEFAULT :CGI); # CGI module
-use CGI::Carp qw(fatalsToBrowser);
-use Date::Format;
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearchs qsearch);
-use FS::CGI qw(header menubar);
-
-my($cgi) = new CGI::Base;
-$cgi->get;
-&cgisuidsetup($cgi);
-
-SendHeaders(); # one guess.
-print header("Customer View", menubar(
-  'Main Menu' => '../',
-)),<
-END
-
-#untaint custnum & get customer record
-$QUERY_STRING =~ /^(\d+)$/;
-my($custnum)=$1;
-my($cust_main)=qsearchs('cust_main',{'custnum'=>$custnum});
-die "Customer not found!" unless $cust_main;
-my($hashref)=$cust_main->hashref;
-
-#custnum
-print "
Customer #$custnum
", - qq!
Customer Information | !, - qq!Comments | !, - qq!Packages | !, - qq!Payment History
!; - -#bill now linke -print qq!
!, - qq!Bill this customer now
!; - -#formatting -print qq!
Customer Information!, - qq!!, - qq!
Edit this information
!; - -#agentnum -my($agent)=qsearchs('agent',{ - 'agentnum' => $cust_main->getfield('agentnum') -} ); -die "Agent not found!" unless $agent; -print "
Agent #" , $agent->getfield('agentnum') , ": " , - $agent->getfield('agent') , ""; - -#refnum -my($referral)=qsearchs('part_referral',{'refnum' => $cust_main->refnum}); -die "Referral not found!" unless $referral; -print "
Referral #", $referral->refnum, ": ", - $referral->referral, "<\B>"; - -#last, first -print "

", $hashref->{'last'}, ", ", $hashref->{first}, ""; - -#ss -print " (SS# ", $hashref->{ss}, ")" if $hashref->{ss}; - -#company -print "
", $hashref->{company}, "" if $hashref->{company}; - -#address1 -print "
", $hashref->{address1}, ""; - -#address2 -print "
", $hashref->{address2}, "" if $hashref->{address2}; - -#city -print "
", $hashref->{city}, ""; - -#county -print " (", $hashref->{county}, " county)" if $hashref->{county}; - -#state -print ",", $hashref->{state}, ""; - -#zip -print " ", $hashref->{zip}, ""; - -#country -print "
", $hashref->{country}, "" - unless $hashref->{country} eq "US"; - -#daytime -print "

", $hashref->{daytime}, "" if $hashref->{daytime}; -print " (Day)" if $hashref->{daytime} && $hashref->{night}; - -#night -print "
", $hashref->{night}, "" if $hashref->{night}; -print " (Night)" if $hashref->{daytime} && $hashref->{night}; - -#fax -print "
", $hashref->{fax}, " (Fax)" if $hashref->{fax}; - -#payby/payinfo/paydate/payname -if ($hashref->{payby} eq "CARD") { - print "

Card #", $hashref->{payinfo}, " Exp. ", - $hashref->{paydate}, ""; - print " (", $hashref->{payname}, ")" if $hashref->{payname}; -} elsif ($hashref->{payby} eq "BILL") { - print "

Bill"; - print " on P.O. #", $hashref->{payinfo}, "" - if $hashref->{payinfo}; - print " until ", $hashref->{paydate}, "" - if $hashref->{paydate}; - print " to ", $hashref->{payname}, " at above address" - if $hashref->{payname}; -} elsif ($hashref->{payby} eq "COMP") { - print "

Access complimentary"; - print " courtesy of ", $hashref->{payinfo}, "" - if $hashref->{payinfo}; - print " until ", $hashref->{paydate}, "" - if $hashref->{paydate}; -} else { - print "Unknown payment type ", $hashref->{payby}, "!"; -} - -#tax -print "
(Tax exempt)" if $hashref->{tax}; - -#otaker -print "

Order taken by ", $hashref->{otaker}, ""; - -#formatting -print qq!


Packages!, - qq!
Click on package number to view/edit package.!, - qq!
Add/Edit packages!, - qq!

!; - -#display packages - -#formatting -print qq!
\n!, - qq!\n!, - qq!!, - qq!!, - qq!\n!; - -#get package info -my(@packages)=qsearch('cust_pkg',{'custnum'=>$custnum}); -my($package); -foreach $package (@packages) { - my($pref)=$package->hashref; - my($part_pkg)=qsearchs('part_pkg',{ - 'pkgpart' => $pref->{pkgpart} - } ); - print qq!!, - "", - "", - "", - "", - "", - "", - ""; -} - -#formatting -print "
#Package!, - qq!Dates
Setup!, - qq!Next bill!, - qq!Susp.Expire!, - qq!Cancel
!, - $pref->{pkgnum}, qq!", $part_pkg->getfield('pkg'), " - ", - $part_pkg->getfield('comment'), "", - $pref->{setup} ? time2str("%D",$pref->{setup} ) : "" , - "", - $pref->{bill} ? time2str("%D",$pref->{bill} ) : "" , - "", - $pref->{susp} ? time2str("%D",$pref->{susp} ) : "" , - "", - $pref->{expire} ? time2str("%D",$pref->{expire} ) : "" , - "", - $pref->{cancel} ? time2str("%D",$pref->{cancel} ) : "" , - "
"; - -#formatting -print qq!

Payment History!, - qq!
!, - qq!Click on invoice to view invoice/enter payment.
!, - qq!!, - qq!Post Credit / Refund

!; - -#get payment history -# -# major problem: this whole thing is way too sloppy. -# minor problem: the description lines need better formatting. - -my(@history); - -my(@bills)=qsearch('cust_bill',{'custnum'=>$custnum}); -my($bill); -foreach $bill (@bills) { - my($bref)=$bill->hashref; - push @history, - $bref->{_date} . qq!\tInvoice #! . $bref->{invnum} . - qq! (Balance \$! . $bref->{owed} . qq!)\t! . - $bref->{charged} . qq!\t\t\t!; - - my(@payments)=qsearch('cust_pay',{'invnum'=> $bref->{invnum} } ); - my($payment); - foreach $payment (@payments) { -# my($pref)=$payment->hashref; - my($date,$invnum,$payby,$payinfo,$paid)=($payment->getfield('_date'), - $payment->getfield('invnum'), - $payment->getfield('payby'), - $payment->getfield('payinfo'), - $payment->getfield('paid'), - ); - push @history, - "$date\tPayment, Invoice #$invnum ($payby $payinfo)\t\t$paid\t\t"; - } -} - -my(@credits)=qsearch('cust_credit',{'custnum'=>$custnum}); -my($credit); -foreach $credit (@credits) { - my($cref)=$credit->hashref; - push @history, - $cref->{_date} . "\tCredit #" . $cref->{crednum} . ", (Balance \$" . - $cref->{credited} . ") by " . $cref->{otaker} . " - " . - $cref->{reason} . "\t\t\t" . $cref->{amount} . "\t"; - - my(@refunds)=qsearch('cust_refund',{'crednum'=> $cref->{crednum} } ); - my($refund); - foreach $refund (@refunds) { - my($rref)=$refund->hashref; - push @history, - $rref->{_date} . "\tRefund, Credit #" . $rref->{crednum} . " (" . - $rref->{payby} . " " . $rref->{payinfo} . ") by " . - $rref->{otaker} . " - ". $rref->{reason} . "\t\t\t\t" . - $rref->{refund}; - } -} - - #formatting - print < - - - - - - - - - -END - -#display payment history - -my($balance)=0; -my($item); -foreach $item (sort keyfield_numerically @history) { - my($date,$desc,$charge,$payment,$credit,$refund)=split(/\t/,$item); - $charge ||= 0; - $payment ||= 0; - $credit ||= 0; - $refund ||= 0; - $balance += $charge - $payment; - $balance -= $credit - $refund; - - print "", - "", - "", - "", - "", - "", - "", - "\n"; -} - -#formatting -print "
DateDescriptionChargePaymentIn-house
Credit
RefundBalance
",time2str("%D",$date),"$desc", - ( $charge ? "\$".sprintf("%.2f",$charge) : '' ), - "", - ( $payment ? "- \$".sprintf("%.2f",$payment) : '' ), - "", - ( $credit ? "- \$".sprintf("%.2f",$credit) : '' ), - "", - ( $refund ? "\$".sprintf("%.2f",$refund) : '' ), - "\$" . sprintf("%.2f",$balance), - "
"; - -#end - -#formatting -print < - -END - -#subroutiens -sub keyfield_numerically { (split(/\t/,$a))[0] <=> (split(/\t/,$b))[0] ; } - diff --git a/htdocs/view/cust_pkg.cgi b/htdocs/view/cust_pkg.cgi deleted file mode 100755 index 04e38326a..000000000 --- a/htdocs/view/cust_pkg.cgi +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/perl -Tw -# -# cust_pkg.cgi: View a package -# -# Usage: cust_pkg.cgi pkgnum -# http://server.name/path/cust_pkg.cgi?pkgnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-dec-15 -# -# services section needs to be cleaned up, needs to display extraneous -# entries in cust_pkg! -# ivan@voicenet.com 96-dec-31 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# changed and fixed up suspension and cancel stuff, now you can't add -# services to a cancelled package -# ivan@voicenet.com 97-feb-27 -# -# rewrote for new API, still needs to be cleaned up! -# ivan@voicenet.com 97-jul-29 -# -# no FS::Search ivan@sisd.com 98-mar-7 - -use strict; -use Date::Format; -use CGI::Base qw(:DEFAULT :CGI); # CGI module -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -my(%uiview,%uiadd); -my($part_svc); -foreach $part_svc ( qsearch('part_svc',{}) ) { - $uiview{$part_svc->svcpart}="../view/". $part_svc->svcdb . ".cgi"; - $uiadd{$part_svc->svcpart}="../edit/". $part_svc->svcdb . ".cgi"; -} - -SendHeaders(); # one guess. -print < - - Package View - - -
-

Package View

-
- -END - -#untaint pkgnum -$QUERY_STRING =~ /^(\d+)$/; -my($pkgnum)=$1; - -#get package record -my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -die "No package!" unless $cust_pkg; -my($part_pkg)=qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); - -#nav bar -my($custnum)=$cust_pkg->getfield('custnum'); -print qq!
View this customer!, - qq! (#$custnum) | Main menu

!; - -#print info -my($susp,$cancel,$expire)=( - $cust_pkg->getfield('susp'), - $cust_pkg->getfield('cancel'), - $cust_pkg->getfield('expire'), -); -print "
Package #$pkgnum"; -print qq!
Package Information!; -print qq! | Service Information! unless $cancel; -print qq!

\n!; - -my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); -print qq!
Package Information!, - qq!!; -print qq!
Edit this information
!; -print "

Package: $pkg - $comment"; - -my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); -print "
Setup: ", $setup ? time2str("%D",$setup) : "(Not setup)" ,""; -print "
Next bill: ", $bill ? time2str("%D",$bill) : "" ,""; - -if ($susp) { - print "
Suspended: ", time2str("%D",$susp), ""; - print qq! Unsuspend! unless $cancel; -} else { - print qq!
Suspend! unless $cancel; -} - -if ($expire) { - print "
Expire: ", time2str("%D",$expire), ""; -} - print < - -Expire (date): - -END - -if ($cancel) { - print "
Cancelled: ", time2str("%D",$cancel), ""; -} else { - print qq!
Cancel now!; -} - -#otaker -my($otaker)=$cust_pkg->getfield('otaker'); -print "

Order taken by $otaker"; - -unless ($cancel) { - - #services - print <

Service Information -
Click on service to view/edit/add service.

-
Do NOT pick the "Link to existing" option unless you are auditing!!!
-
- -END - - #list of services this pkgpart includes - my($pkg_svc,%pkg_svc); - foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) { - $pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity; - } - - #list of records from cust_svc - my($svcpart); - foreach $svcpart (sort {$a <=> $b} keys %pkg_svc) { - - my($svc)=qsearchs('part_svc',{'svcpart'=>$svcpart})->getfield('svc'); - - my(@cust_svc)=qsearch('cust_svc',{'pkgnum'=>$pkgnum, - 'svcpart'=>$svcpart, - }); - - my($enum); - for $enum ( 1 .. $pkg_svc{$svcpart} ) { - - my($cust_svc); - if ( $cust_svc=shift @cust_svc ) { - my($svcnum)=$cust_svc->svcnum; - print < -END - } else { - print < - - -END - } - - } - warn "WARNING: Leftover services pkgnum $pkgnum!" if @cust_svc;; - } - - print "
Service(View) $svc
- (Add) $svc - or - (Link to existing) $svc -
"; - -} - -#formatting -print < - -END - diff --git a/htdocs/view/svc_acct.cgi b/htdocs/view/svc_acct.cgi deleted file mode 100755 index 7096c2fb1..000000000 --- a/htdocs/view/svc_acct.cgi +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/perl -Tw -# -# View svc_acct records -# -# Usage: svc_acct.cgi svcnum -# http://server.name/path/svc_acct.cgi?svcnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 96-dec-17 -# -# added link to send info -# ivan@voicenet.com 97-jan-4 -# -# added navigation bar and ability to change username, etc. -# ivan@voicenet.com 97-jan-30 -# -# activate 800 service -# ivan@voicenet.com 97-feb-10 -# -# modified navbar code (should be a subroutine?), added link to cancel account (only if not audited) -# ivan@voicenet.com 97-apr-16 -# -# INCOMPLETELY rewrote some things for new API -# ivan@voicenet.com 97-jul-29 -# -# FS::Search became FS::Record, use strict, etc. ivan@sisd.com 98-mar-9 -# -# Changes to allow page to work at a relative position in server -# Changed 'password' to '_password' because Pg6.3 reserves the password word -# bmccane@maxbaud.net 98-apr-3 -# -# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-17 -# -# displays arbitrary radius attributes ivan@sisd.com 98-aug-16 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs fields); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1; -} grep $_ !~ /^(#|$)/, ; - -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; -my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$svcnum}); -die "Unkonwn svcnum" unless $svc_acct; - -my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my($pkgnum)=$cust_svc->getfield('pkgnum'); -my($cust_pkg,$custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} - -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -die "Unkonwn svcpart" unless $part_svc; - -SendHeaders(); # one guess. -print < - - Account View - - -

Account View

- -
-END - -if ($pkgnum || $custnum) { - print <View this package (#$pkgnum) | -View this customer (#$custnum) | -END -} else { - print <Cancel this (unaudited)account | -END -} - -print <Main menu

-Service #$svcnum -END - -print qq!
Edit this information!; -#print qq!
Send account information!; -print qq!

General | Shell account | !; -print qq!SLIP/PPP account
!; - -#formatting -print qq!
General
!; - -#svc -print "Service: ", $part_svc->svc, ""; - -#username -print "
Username: ", $svc_acct->username, ""; - -#password -if (substr($svc_acct->_password,0,1) eq "*") { - print "
Password: (Login disabled)
"; -} else { - print "
Password: (hidden)
"; -} - -# popnum -> svc_acct_pop record -my($svc_acct_pop)=qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum}); - -#pop -print "POP: ", $svc_acct_pop->city, ", ", $svc_acct_pop->state, - " (", $svc_acct_pop->ac, ")/", $svc_acct_pop->exch, "<\B>" - if $svc_acct_pop; - -#shell account -print qq!
!; -if ($svc_acct->uid ne '') { - print "Shell account"; - print "
"; - print "Uid: ", $svc_acct->uid, ""; - print "
Gid: ", $svc_acct->gid, ""; - - print qq!
Finger name: !, $svc_acct->finger, qq!
!; - - print "Home directory: ", $svc_acct->dir, "
"; - - print "Shell: ", $svc_acct->shell, "
"; - - print "Quota: ", $svc_acct->quota, " (unimplemented)"; -} else { - print "No shell account.
"; -} - -# SLIP/PPP -print qq!
!; -if ($svc_acct->slipip) { - print "SLIP/PPP account
"; - 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_/, fields('svc_acct') ) { - #warn $attribute; - $attribute =~ /^radius_(.*)$/; - my($pattribute) = ($1); - $pattribute =~ s/_/-/g; - print "
Radius $pattribute: ". $svc_acct->getfield($attribute), ""; - } -} else { - print "No SLIP/PPP account" -} - -print "
"; - - #formatting - print < - -END - diff --git a/htdocs/view/svc_acct_sm.cgi b/htdocs/view/svc_acct_sm.cgi deleted file mode 100755 index 42623eefd..000000000 --- a/htdocs/view/svc_acct_sm.cgi +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/perl -Tw -# -# View svc_acct_sm records -# -# Usage: svc_acct_sm.cgi svcnum -# http://server.name/path/svc_acct_sm.cgi?svcnum -# -# Note: Should be run setuid freeside as user nobody. -# -# based on view/svc_acct.cgi -# -# ivan@voicenet.com 97-jan-5 -# -# added navigation bar -# ivan@voicenet.com 97-jan-30 -# -# rewrite ivan@sisd.com 98-mar-15 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-17 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my($conf_domain)="/var/spool/freeside/conf/domain"; -open(DOMAIN,$conf_domain) or die "Can't open $conf_domain: $!"; -my($mydomain)=map { - /^(.*)$/ or die "Illegal line in $conf_domain!"; #yes, we trust the file - $1 -} grep $_ !~ /^(#|$)/, ; -close DOMAIN; - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; -my($svc_acct_sm)=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}); -die "Unknown svcnum" unless $svc_acct_sm; - -my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my($pkgnum)=$cust_svc->getfield('pkgnum'); -my($cust_pkg,$custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} - -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -die "Unkonwn svcpart" unless $part_svc; - -SendHeaders(); # one guess. -print < - - Mail Alias View - - -

Mail Alias View

-END -if ($pkgnum || $custnum) { - print <View this package (#$pkgnum) | -View this customer (#$custnum) | -END -} else { - print <Cancel this (unaudited)account | -END -} - -print <Main menu
Service #$svcnum -

Edit this information - -END - -my($domsvc,$domuid,$domuser)=( - $svc_acct_sm->domsvc, - $svc_acct_sm->domuid, - $svc_acct_sm->domuser, -); -my($svc) = $part_svc->svc; -my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$domsvc}); -my($domain)=$svc_domain->domain; -my($svc_acct)=qsearchs('svc_acct',{'uid'=>$domuid}); -my($username)=$svc_acct->username; - -#formatting -print qq!


!; - -#svc -print "Service: $svc"; - -print "
"; - -print qq!Mail to !, ( ($domuser eq '*') ? "(anything)" : $domuser ) , qq!\@$domain forwards to $username\@$mydomain mailbox.!; - -print "
"; - - #formatting - print < - -END - diff --git a/htdocs/view/svc_domain.cgi b/htdocs/view/svc_domain.cgi deleted file mode 100755 index 78ff6ac0b..000000000 --- a/htdocs/view/svc_domain.cgi +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/perl -Tw -# -# View svc_domain records -# -# Usage: svc_domain svcnum -# http://server.name/path/svc_domain.cgi?svcnum -# -# Note: Should be run setuid freeside as user nobody. -# -# ivan@voicenet.com 97-jan-6 -# -# rewrite ivan@sisd.com 98-mar-14 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 - -use strict; -use CGI::Base qw(:DEFAULT :CGI); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearchs); - -my($cgi) = new CGI::Base; -$cgi->get; -cgisuidsetup($cgi); - -#untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; -my($svcnum)=$1; -my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$svcnum}); -die "Unknown svcnum" unless $svc_domain; -my($domain)=$svc_domain->domain; - -my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum}); -my($pkgnum)=$cust_svc->getfield('pkgnum'); -my($cust_pkg,$custnum); -if ($pkgnum) { - $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); - $custnum=$cust_pkg->getfield('custnum'); -} - -my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); -die "Unkonwn svcpart" unless $part_svc; - -SendHeaders(); # one guess. -print < - - Domain View - - -

Domain View

- -
-View this package (#$pkgnum) | -View this customer (#$custnum) | -Main menu

- Service #$svcnum -
-END - -print "
"; -print "Service: ", $part_svc->svc, ""; -print "
"; - -print qq!Domain name $domain.!; -print qq!

View whois information.!; - -print "


"; - - #formatting - print < - -END - -- cgit v1.2.1