diff options
author | ivan <ivan> | 1998-11-13 09:56:57 +0000 |
---|---|---|
committer | ivan <ivan> | 1998-11-13 09:56:57 +0000 |
commit | 0bf5ad9ff0a65195db88ed0bac3aa11c33ec1ad3 (patch) | |
tree | e1f4e0dd775f4b4c82f23140f27609d26216f9fe /htdocs | |
parent | f6ef3dec7840be2e7ac7c39bed32a7ea68425b2d (diff) |
change configuration file layout to support multiple distinct databases (with
own set of config files, export, etc.)
Diffstat (limited to 'htdocs')
-rw-r--r-- | htdocs/docs/man/CGI.txt | 36 | ||||
-rw-r--r-- | htdocs/docs/man/Conf.txt | 17 | ||||
-rw-r--r-- | htdocs/docs/man/Record.txt | 27 | ||||
-rw-r--r-- | htdocs/docs/man/UID.txt | 64 | ||||
-rw-r--r-- | htdocs/docs/man/cust_bill.txt | 8 | ||||
-rw-r--r-- | htdocs/docs/man/cust_main.txt | 8 | ||||
-rw-r--r-- | htdocs/docs/man/cust_pkg.txt | 13 | ||||
-rw-r--r-- | htdocs/docs/man/cust_svc.txt | 22 | ||||
-rw-r--r-- | htdocs/docs/man/dbdef_table.txt | 9 | ||||
-rw-r--r-- | htdocs/docs/man/svc_acct.txt | 6 | ||||
-rw-r--r-- | htdocs/docs/man/svc_domain.txt | 18 | ||||
-rwxr-xr-x | htdocs/edit/agent_type.cgi | 15 | ||||
-rwxr-xr-x | htdocs/edit/svc_acct_pop.cgi | 17 | ||||
-rwxr-xr-x | htdocs/edit/svc_domain.cgi | 22 | ||||
-rwxr-xr-x | htdocs/view/cust_pkg.cgi | 19 | ||||
-rwxr-xr-x | htdocs/view/svc_domain.cgi | 16 |
16 files changed, 251 insertions, 66 deletions
diff --git a/htdocs/docs/man/CGI.txt b/htdocs/docs/man/CGI.txt index 54f9b8a6a..15a5ca17d 100644 --- a/htdocs/docs/man/CGI.txt +++ b/htdocs/docs/man/CGI.txt @@ -2,7 +2,7 @@ NAME FS::CGI - Subroutines for the web interface SYNOPSIS - use FS::CGI qw(header menubar idiot eidiot); + use FS::CGI qw(header menubar idiot eidiot popurl); print header( 'Title', '' ); print header( 'Title', menubar('item', 'URL', ... ) ); @@ -10,6 +10,9 @@ SYNOPSIS idiot "error message"; eidiot "error message"; + $url = popurl; #returns current url + $url = popurl(3); #three levels up + DESCRIPTION Provides a few common subroutines for the web interface. @@ -26,15 +29,20 @@ SUBROUTINES eidiot ERROR Sends headers and an HTML error message, then exits. + popurl LEVEL + Returns current URL with LEVEL levels of path removed from + the end (default 0). + + table + Returns HTML tag for beginning a table. + BUGS Not OO. Not complete. - Uses CGI-modules instead of CGI.pm - SEE ALSO - the CGI::Base manpage + the CGI manpage, the CGI::Base manpage HISTORY subroutines for the HTML/CGI GUI, not properly OO. :( @@ -45,3 +53,23 @@ HISTORY pod ivan@sisd.com 98-sep-12 + $Log: CGI.txt,v $ + Revision 1.2 1998-11-13 09:56:34 ivan + change configuration file layout to support multiple distinct databases (with + own set of config files, export, etc.) + Revision 1.11 1998/11/12 07:43:54 ivan *** + empty log message *** + + Revision 1.10 1998/11/12 01:53:47 ivan added table command + + Revision 1.9 1998/11/09 08:51:49 ivan bug squash + + Revision 1.7 1998/11/09 06:10:59 ivan added sub url + + Revision 1.6 1998/11/09 05:44:20 ivan *** empty log message *** + + Revision 1.4 1998/11/09 04:55:42 ivan support depriciated + CGI::Base as well as CGI.pm (for now) + + Revision 1.3 1998/11/08 10:50:19 ivan s/CGI::Base/CGI/; etc. + diff --git a/htdocs/docs/man/Conf.txt b/htdocs/docs/man/Conf.txt index 5e7be7f2d..816df7995 100644 --- a/htdocs/docs/man/Conf.txt +++ b/htdocs/docs/man/Conf.txt @@ -4,8 +4,10 @@ NAME SYNOPSIS use FS::Conf; + $conf = new FS::Conf "/config/directory"; + + $FS::Conf::default_dir = "/config/directory"; $conf = new FS::Conf; - $conf = new FS::Conf "/non/standard/config/directory"; $dir = $conf->dir; @@ -19,8 +21,8 @@ DESCRIPTION METHODS new [ DIRECTORY ] - Create a new configuration object. Optionally, a non-default - directory may be specified. + Create a new configuration object. A directory arguement is + required if $FS::Conf::default_dir has not been set. dir Returns the directory. @@ -33,9 +35,6 @@ METHODS corresponding value is undefined. BUGS - The option to specify a non-default directory should probably be - removed. - Write access (with locking) should be implemented. SEE ALSO @@ -47,3 +46,9 @@ HISTORY sub exists forgot to fetch $dir ivan@sisd.com 98-sep-27 + $Log: Conf.txt,v $ + Revision 1.4 1999-02-09 09:37:48 ivan + regenerated perl api docs from embedded pod + Revision 1.2 1998/11/13 04:08:44 ivan no + default default_dir (ironic) + diff --git a/htdocs/docs/man/Record.txt b/htdocs/docs/man/Record.txt index 757013286..8409c2ecc 100644 --- a/htdocs/docs/man/Record.txt +++ b/htdocs/docs/man/Record.txt @@ -77,15 +77,15 @@ METHODS qsearch TABLE, HASHREF Searches the database for all records matching (at least) the key/value pairs in HASHREF. Returns all the records - found as FS::Record objects. + found as `FS::TABLE' objects if that module is loaded (i.e. + via `use FS::cust_main;'), otherwise returns FS::Record + objects. qsearchs TABLE, HASHREF - Searches the database for a record matching (at least) the - key/value pairs in HASHREF, and returns the record found as - an FS::Record object. If more than one record matches, it - carps but returns the first. If this happens, you either - made a logic error in asking for a single item, or your data - is corrupted. + Same as qsearch, except that if more than one record + matches, it carps but returns the first. If this happens, + you either made a logic error in asking for a single item, + or your data is corrupted. table Returns the table name. @@ -236,7 +236,7 @@ BUGS ut_sqltype (like ut_varchar) should all be defined - A fallback check method should be provided with uses the + A fallback check method should be provided whith uses the dbdef. The ut_money method assumes money has two decimal digits. @@ -332,3 +332,14 @@ HISTORY ut_phonen got ''; at the end ivan@sisd.com 98-sep-27 + $Log: Record.txt,v $ + Revision 1.3 1998-11-13 09:56:36 ivan + change configuration file layout to support multiple distinct databases (with + own set of config files, export, etc.) + Revision 1.4 1998/11/10 07:45:25 ivan + doc clarification + + Revision 1.2 1998/11/07 05:17:18 ivan In sub new, Pg wrapper + for money fields from dbdef (FS::Record::fields $table), not + keys of supplied hashref. + diff --git a/htdocs/docs/man/UID.txt b/htdocs/docs/man/UID.txt index bf9f6b4bd..e24636487 100644 --- a/htdocs/docs/man/UID.txt +++ b/htdocs/docs/man/UID.txt @@ -6,10 +6,9 @@ SYNOPSIS use FS::UID qw(adminsuidsetup cgisuidsetup dbh datasrc getotaker checkeuid checkruid swapuid); - adminsuidsetup; + adminsuidsetup $user; - $cgi = new CGI::Base; - $cgi->get; + $cgi = new CGI; $dbh = cgisuidsetup($cgi); $dbh = dbh; @@ -20,20 +19,32 @@ DESCRIPTION Provides a hodgepodge of subroutines. SUBROUTINES - adminsuidsetup - Cleans the environment. Make sure the script is running as - freeside, or setuid freeside. Opens a connection to the - database. Swaps real and effective UIDs. Returns the DBI + adminsuidsetup USER + Sets the user to USER (see config.html from the base + documentation). Cleans the environment. Make sure the script + is running as freeside, or setuid freeside. Opens a + connection to the database. Swaps real and effective UIDs. + Runs any defined callbacks (see below). Returns the DBI database handle (usually you don't need this). + cgisuidsetup CGI_object + Stores the CGI (see the CGI manpage) object for later use. + (CGI::Base is depriciated) Runs adminsuidsetup. + + cgi Returns the CGI (see the CGI manpage) object. + dbh Returns the DBI database handle. datasrc Returns the DBI data source. getotaker - Returns the current Freeside user. Currently that means the - CGI REMOTE_USER, or 'freeside'. + Returns the current Freeside user. + + cgisetotaker + Sets and returns the CGI REMOTE_USER. $cgi should be defined + as a CGI.pm object. Support for CGI::Base and derived + classes is depriciated. checkeuid Returns true if effective UID is that of the freeside user. @@ -44,14 +55,36 @@ SUBROUTINES swapuid Swaps real and effective UIDs. + getsecrets [ USER ] + Sets the user to USER, if supplied. Sets and returns the DBI + datasource, username and password for this user from the + `/usr/local/etc/freeside/mapsecrets' file. + +CALLBACKS + Warning: this interface is likely to change in future releases. + + A package can install a callback to be run in adminsuidsetup by + putting a coderef into the hash %FS::UID::callback : + + $coderef = sub { warn "Hi, I'm returning your call!" }; + $FS::UID::callback{'Package::Name'}; + BUGS + Too many package-global variables. + Not OO. No capabilities yet. When mod_perl and Authen::DBI are implemented, cgisuidsetup will go away as well. + Goes through contortions to support non-OO syntax with multiple + datasrc's. + + Callbacks are inelegant. + SEE ALSO - the FS::Record manpage, the CGI::Base manpage, the DBI manpage + the FS::Record manpage, the CGI manpage, the DBI manpage, + config.html from the base documentation. HISTORY ivan@voicenet.com 97-jun-4 - 9 untaint otaker ivan@voicenet.com @@ -77,3 +110,14 @@ HISTORY pod, use FS::Conf, implemented cgisuidsetup as adminsuidsetup, inlined suidsetup ivan@sisd.com 98-sep-12 + $Log: UID.txt,v $ + Revision 1.2 1998-11-13 09:56:37 ivan + change configuration file layout to support multiple distinct databases (with + own set of config files, export, etc.) + Revision 1.3 1998/11/08 10:45:42 ivan got sub + cgi for FS::CGI + + Revision 1.2 1998/11/08 09:38:43 ivan cgisuidsetup complains if + you pass it a isa CGI::Base instead of an isa CGI (first step in + migrating from CGI-modules to CGI.pm) + diff --git a/htdocs/docs/man/cust_bill.txt b/htdocs/docs/man/cust_bill.txt index 9762dd3ca..bc0b64da3 100644 --- a/htdocs/docs/man/cust_bill.txt +++ b/htdocs/docs/man/cust_bill.txt @@ -138,3 +138,11 @@ HISTORY pod, ingegrate with FS::Invoice ivan@sisd.com 98-sep-20 + $Log: cust_bill.txt,v $ + Revision 1.2 1998-11-13 09:56:38 ivan + change configuration file layout to support multiple distinct databases (with + own set of config files, export, etc.) + Revision 1.2 1998/11/07 10:24:24 ivan + don't use depriciated FS::Bill and FS::Invoice, other + miscellania + diff --git a/htdocs/docs/man/cust_main.txt b/htdocs/docs/man/cust_main.txt index df7848744..f0625c173 100644 --- a/htdocs/docs/man/cust_main.txt +++ b/htdocs/docs/man/cust_main.txt @@ -198,3 +198,11 @@ HISTORY cybercash v3 support, don't need to import FS::UID::{datasrc,checkruid} ivan@sisd.com 98-sep-19-21 + $Log: cust_main.txt,v $ + Revision 1.2 1998-11-13 09:56:39 ivan + change configuration file layout to support multiple distinct databases (with + own set of config files, export, etc.) + Revision 1.2 1998/11/07 10:24:25 ivan + don't use depriciated FS::Bill and FS::Invoice, other + miscellania + diff --git a/htdocs/docs/man/cust_pkg.txt b/htdocs/docs/man/cust_pkg.txt index 5409083d8..c5d143dbe 100644 --- a/htdocs/docs/man/cust_pkg.txt +++ b/htdocs/docs/man/cust_pkg.txt @@ -21,6 +21,8 @@ SYNOPSIS $error = $record->unsuspend; + $part_pkg = $record->part_pkg; + $error = FS::cust_pkg::order( $custnum, \@pkgparts ); $error = FS::cust_pkg::order( $custnum, \@pkgparts, \@remove_pkgnums ] ); @@ -108,6 +110,10 @@ METHODS If there is an error, returns the error, otherwise returns false. + part_pkg + Returns the definition for this billing item, as an + FS::part_pkg object (see L<FS::part_pkg). + SUBROUTINES order CUSTNUM, PKGPARTS_ARYREF, [ REMOVE_PKGNUMS_ARYREF ] CUSTNUM is a customer (see the FS::cust_main manpage) @@ -148,3 +154,10 @@ HISTORY pod ivan@sisd.com 98-sep-21 + $Log: cust_pkg.txt,v $ + Revision 1.2 1998-11-13 09:56:40 ivan + change configuration file layout to support multiple distinct databases (with + own set of config files, export, etc.) + Revision 1.2 1998/11/12 03:42:45 ivan + added label method + diff --git a/htdocs/docs/man/cust_svc.txt b/htdocs/docs/man/cust_svc.txt index d863ea852..adc1ca23f 100644 --- a/htdocs/docs/man/cust_svc.txt +++ b/htdocs/docs/man/cust_svc.txt @@ -15,6 +15,8 @@ SYNOPSIS $error = $record->check; + ($label, $value) = $record->label; + DESCRIPTION An FS::cust_svc represents a service. FS::cust_svc inherits from FS::Record. The following fields are currently supported: @@ -51,12 +53,18 @@ METHODS there is an error, returns the error, otehrwise returns false. Called by the insert and replace methods. + label + Returns a list consisting of: - The name of this service + (from part_svc) - A meaningful identifier (username, domain, + or mail alias) - The table name (i.e. svc_domain) for this + service + BUGS Behaviour of changing the svcpart of cust_svc records is undefined and should possibly be prohibited, and pkg_svc records are not checked. - pkg_svc records are not checket in general (here). + pkg_svc records are not checked in general (here). SEE ALSO the FS::Record manpage, the FS::cust_pkg manpage, the @@ -70,3 +78,15 @@ HISTORY pod ivan@sisd.com 98-sep-21 + $Log: cust_svc.txt,v $ + Revision 1.2 1998-11-13 09:56:41 ivan + change configuration file layout to support multiple distinct databases (with + own set of config files, export, etc.) + Revision 1.4 1998/11/12 07:58:15 ivan + added svcdb to label + + Revision 1.3 1998/11/12 03:45:38 ivan use FS::table_name for all + tables qsearch()'ed + + Revision 1.2 1998/11/12 03:32:46 ivan added label method + diff --git a/htdocs/docs/man/dbdef_table.txt b/htdocs/docs/man/dbdef_table.txt index 4fcb0935c..1a1887156 100644 --- a/htdocs/docs/man/dbdef_table.txt +++ b/htdocs/docs/man/dbdef_table.txt @@ -76,7 +76,7 @@ SEE ALSO manpage VERSION - $Id: dbdef_table.txt,v 1.2 1998-10-14 06:52:48 ivan Exp $ + $Id: dbdef_table.txt,v 1.5 1999-04-08 13:39:32 ivan Exp $ HISTORY class for dealing with table definitions @@ -96,7 +96,8 @@ HISTORY pod ivan@sisd.com 98-sep-24 $Log: dbdef_table.txt,v $ - Revision 1.2 1998-10-14 06:52:48 ivan - 1,1,4 release, fix postgresql quirks. - + Revision 1.5 1999-04-08 13:39:32 ivan + convert from pod for 1.2.0 release + Revision 1.2 1998/10/14 07:05:06 ivan + 1.1.4 release, fix postgresql diff --git a/htdocs/docs/man/svc_acct.txt b/htdocs/docs/man/svc_acct.txt index 1c9caf5fb..4c4e8e2c4 100644 --- a/htdocs/docs/man/svc_acct.txt +++ b/htdocs/docs/man/svc_acct.txt @@ -166,3 +166,9 @@ HISTORY pod and FS::conf ivan@sisd.com 98-sep-22 + $Log: svc_acct.txt,v $ + Revision 1.2 1998-11-13 09:56:44 ivan + change configuration file layout to support multiple distinct databases (with + own set of config files, export, etc.) + + diff --git a/htdocs/docs/man/svc_domain.txt b/htdocs/docs/man/svc_domain.txt index 03d3dbc27..da8c06015 100644 --- a/htdocs/docs/man/svc_domain.txt +++ b/htdocs/docs/man/svc_domain.txt @@ -47,6 +47,13 @@ METHODS A registration or transfer email will be submitted unless $FS::svc_domain::whois_hack is true. + The additional field *email* can be used to manually set the + admin contact email address on this email. Otherwise, the + svc_acct records for this package (see the FS::cust_pkg + manpage) are searched. If there is exactly one svc_acct + record in the same package, it is automatically used. + Otherwise an error is returned. + delete Deletes this domain from the database. If there is an error, returns the error, otherwise returns false. @@ -114,6 +121,9 @@ SEE ALSO schema.html from the base documentation, config.html from the base documentation. +VERSION + $Id: svc_domain.txt,v 1.2 1998-11-13 09:56:45 ivan Exp $ + HISTORY ivan@voicenet.com 97-jul-21 @@ -129,3 +139,11 @@ HISTORY pod, some FS::Conf (not complete) ivan@sisd.com 98-sep-23 + $Log: svc_domain.txt,v $ + Revision 1.2 1998-11-13 09:56:45 ivan + change configuration file layout to support multiple distinct databases (with + own set of config files, export, etc.) + Revision 1.2 1998/10/14 08:18:21 ivan + More informative error messages and better doc for admin contact + email stuff + diff --git a/htdocs/edit/agent_type.cgi b/htdocs/edit/agent_type.cgi index b9fff4530..9f3748d3d 100755 --- a/htdocs/edit/agent_type.cgi +++ b/htdocs/edit/agent_type.cgi @@ -9,22 +9,25 @@ # bmccane@maxbaud.net 98-apr-3 # # use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 +# +# $Log: agent_type.cgi,v $ +# Revision 1.2 1998-11-13 09:56:46 ivan +# change configuration file layout to support multiple distinct databases (with +# own set of config files, export, etc.) +# use strict; -use CGI::Base; +use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); use FS::Record qw(qsearch qsearchs); use FS::agent_type; use FS::CGI qw(header menubar); -my($cgi) = new CGI::Base; -$cgi->get; +my($cgi) = new CGI; &cgisuidsetup($cgi); -SendHeaders(); # one guess. - my($agent_type,$action); if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing $agent_type=qsearchs('agent_type',{'typenum'=>$1}); @@ -35,7 +38,7 @@ if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing } my($hashref)=$agent_type->hashref; -print header("$action Agent Type", menubar( +print $cgi->header, header("$action Agent Type", menubar( 'Main Menu' => '../', 'View all agent types' => '../browse/agent_type.cgi', )), '<FORM ACTION="process/agent_type.cgi" METHOD=POST>'; diff --git a/htdocs/edit/svc_acct_pop.cgi b/htdocs/edit/svc_acct_pop.cgi index 46d803f07..58e8b7ee6 100755 --- a/htdocs/edit/svc_acct_pop.cgi +++ b/htdocs/edit/svc_acct_pop.cgi @@ -8,24 +8,27 @@ # bmccane@maxbaud.net 98-apr-3 # # lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: svc_acct_pop.cgi,v $ +# Revision 1.2 1998-11-13 09:56:47 ivan +# change configuration file layout to support multiple distinct databases (with +# own set of config files, export, etc.) +# use strict; -use CGI::Base; +use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); use FS::Record qw(qsearch qsearchs); use FS::svc_acct_pop; use FS::CGI qw(header menubar); -my($cgi) = new CGI::Base; -$cgi->get; +my($cgi) = new CGI; &cgisuidsetup($cgi); -SendHeaders(); # one guess. - my($svc_acct_pop,$action); -if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing +if ( $cgi->query_string =~ /^(\d+)$/ ) { #editing $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1}); $action='Edit'; } else { #adding @@ -34,7 +37,7 @@ if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing } my($hashref)=$svc_acct_pop->hashref; -print header("$action POP", menubar( +print $cgi->header, header("$action POP", menubar( 'Main Menu' => '../', 'View all POPs' => "../browse/svc_acct_pop.cgi", )), <<END; diff --git a/htdocs/edit/svc_domain.cgi b/htdocs/edit/svc_domain.cgi index 0717a2c09..dd436334c 100755 --- a/htdocs/edit/svc_domain.cgi +++ b/htdocs/edit/svc_domain.cgi @@ -15,20 +15,26 @@ # rewrite ivan@sisd.com 98-mar-14 # # no GOV in instructions ivan@sisd.com 98-jul-17 +# +# $Log: svc_domain.cgi,v $ +# Revision 1.2 1998-11-13 09:56:48 ivan +# change configuration file layout to support multiple distinct databases (with +# own set of config files, export, etc.) +# use strict; -use CGI::Base qw(:DEFAULT :CGI); +use CGI; +use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup getotaker); use FS::Record qw(qsearch qsearchs); use FS::svc_domain qw(fields); -my($cgi) = new CGI::Base; -$cgi->get; +my($cgi) = new CGI; &cgisuidsetup($cgi); my($action,$svcnum,$svc_domain,$pkgnum,$svcpart,$part_svc); -if ( $QUERY_STRING =~ /^(\d+)$/ ) { #editing +if ( $cgi->query_string =~ /^(\d+)$/ ) { #editing $svcnum=$1; $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum}) @@ -49,7 +55,7 @@ if ( $QUERY_STRING =~ /^(\d+)$/ ) { #editing $svc_domain=create FS::svc_domain({}); - foreach $_ (split(/-/,$QUERY_STRING)) { + foreach $_ (split(/-/,$cgi->query_string)) { $pkgnum=$1 if /^pkgnum(\d+)$/; $svcpart=$1 if /^svcpart(\d+)$/; } @@ -78,8 +84,7 @@ my($domain)=( $svc_domain->domain, ); -SendHeaders(); -print <<END; +print $cgi->header, <<END; <HTML> <HEAD> <TITLE>$action $svc</TITLE> @@ -112,7 +117,8 @@ Domain Name Registration Agreement</A> </UL> US state and local government agencies, schools, libraries, museums, and individuals should register under the US domain. See RFC 1480 for a complete description of the US domain and registration procedures. -<P>GOV registrations are limited to top-level US Federal Government agencies (see RFC 1816). +<!-- <P>GOV registrations are limited to top-level US Federal Government agencies (see RFC 1816). +!--> </FORM> </BODY> </HTML> diff --git a/htdocs/view/cust_pkg.cgi b/htdocs/view/cust_pkg.cgi index 04e38326a..d7269281f 100755 --- a/htdocs/view/cust_pkg.cgi +++ b/htdocs/view/cust_pkg.cgi @@ -24,22 +24,29 @@ # ivan@voicenet.com 97-jul-29 # # no FS::Search ivan@sisd.com 98-mar-7 +# +# $Log: cust_pkg.cgi,v $ +# Revision 1.2 1998-11-13 09:56:49 ivan +# change configuration file layout to support multiple distinct databases (with +# own set of config files, export, etc.) +# use strict; use Date::Format; -use CGI::Base qw(:DEFAULT :CGI); # CGI module +use CGI; +use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); +use FS::CGI qw(url); use FS::Record qw(qsearch qsearchs); -my($cgi) = new CGI::Base; -$cgi->get; -&cgisuidsetup($cgi); +my($cgi) = new CGI; +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"; + $uiview{$part_svc->svcpart} = url(1). "/view/". $part_svc->svcdb . ".cgi"; + $uiadd{$part_svc->svcpart}= url(1). "/edit/". $part_svc->svcdb . ".cgi"; } SendHeaders(); # one guess. diff --git a/htdocs/view/svc_domain.cgi b/htdocs/view/svc_domain.cgi index 78ff6ac0b..fa35a8cd5 100755 --- a/htdocs/view/svc_domain.cgi +++ b/htdocs/view/svc_domain.cgi @@ -13,18 +13,23 @@ # # Changes to allow page to work at a relative position in server # bmccane@maxbaud.net 98-apr-3 +# +# $Log: svc_domain.cgi,v $ +# Revision 1.2 1998-11-13 09:56:50 ivan +# change configuration file layout to support multiple distinct databases (with +# own set of config files, export, etc.) +# use strict; -use CGI::Base qw(:DEFAULT :CGI); +use CGI; use FS::UID qw(cgisuidsetup); use FS::Record qw(qsearchs); -my($cgi) = new CGI::Base; -$cgi->get; +my($cgi) = new CGI; cgisuidsetup($cgi); #untaint svcnum -$QUERY_STRING =~ /^(\d+)$/; +$cgi->query_string =~ /^(\d+)$/; my($svcnum)=$1; my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$svcnum}); die "Unknown svcnum" unless $svc_domain; @@ -41,8 +46,7 @@ if ($pkgnum) { my($part_svc)=qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } ); die "Unkonwn svcpart" unless $part_svc; -SendHeaders(); # one guess. -print <<END; +print $cgi->header, <<END; <HTML> <HEAD> <TITLE>Domain View</TITLE> |