3 # $Id: svc_domain.cgi,v 1.9 1999-02-28 00:03:39 ivan Exp $
5 # Usage: svc_domain.cgi pkgnum{pkgnum}-svcpart{svcpart}
6 # http://server.name/path/svc_domain.cgi?pkgnum{pkgnum}-svcpart{svcpart}
8 # ivan@voicenet.com 97-jan-5 -> 97-jan-6
10 # changes for domain template 3.5
11 # ivan@voicenet.com 97-jul-24
13 # rewrite ivan@sisd.com 98-mar-14
15 # no GOV in instructions ivan@sisd.com 98-jul-17
17 # $Log: svc_domain.cgi,v $
18 # Revision 1.9 1999-02-28 00:03:39 ivan
19 # removed misleading comments
21 # Revision 1.8 1999/02/07 09:59:25 ivan
22 # more mod_perl fixes, and bugfixes Peter Wemm sent via email
24 # Revision 1.7 1999/01/19 05:13:46 ivan
25 # for mod_perl: no more top-level my() variables; use vars instead
26 # also the last s/create/new/;
28 # Revision 1.6 1999/01/18 09:41:35 ivan
29 # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
32 # Revision 1.5 1998/12/30 23:03:25 ivan
33 # bugfixes; fields isn't exported by derived classes
35 # Revision 1.4 1998/12/23 03:00:16 ivan
36 # $cgi->keywords instead of $cgi->query_string
38 # Revision 1.3 1998/12/17 06:17:12 ivan
39 # fix double // in relative URLs, s/CGI::Base/CGI/;
41 # Revision 1.2 1998/11/13 09:56:48 ivan
42 # change configuration file layout to support multiple distinct databases (with
43 # own set of config files, export, etc.)
47 use vars qw( $cgi $action $svcnum $svc_domain $pkgnum $svcpart $part_svc
48 $svc $otaker $domain $p1 $kludge_action $purpose );
50 use CGI::Carp qw(fatalsToBrowser);
51 use FS::UID qw(cgisuidsetup getotaker);
52 use FS::CGI qw(header popurl);
53 use FS::Record qw(qsearch qsearchs fields);
59 if ( $cgi->param('error') ) {
60 $svc_domain = new FS::svc_domain ( {
61 map { $_, scalar($cgi->param($_)) } fields('svc_domain')
63 $svcnum = $svc_domain->svcnum;
64 $pkgnum = $cgi->param('pkgnum');
65 $svcpart = $cgi->param('svcpart');
66 $kludge_action = $cgi->param('action');
67 $purpose = $cgi->param('purpose');
68 $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } );
69 die "No part_svc entry!" unless $part_svc;
73 my($query) = $cgi->keywords;
74 if ( $query =~ /^(\d+)$/ ) { #editing
76 $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum})
77 or die "Unknown (svc_domain) svcnum!";
79 my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
80 or die "Unknown (cust_svc) svcnum!";
82 $pkgnum=$cust_svc->pkgnum;
83 $svcpart=$cust_svc->svcpart;
85 $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
86 die "No part_svc entry!" unless $part_svc;
90 $svc_domain = new FS::svc_domain({});
92 foreach $_ (split(/-/,$query)) {
93 $pkgnum=$1 if /^pkgnum(\d+)$/;
94 $svcpart=$1 if /^svcpart(\d+)$/;
96 $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
97 die "No part_svc entry!" unless $part_svc;
101 #set fixed and default fields from part_svc
103 foreach $field ( fields('svc_domain') ) {
104 if ( $part_svc->getfield('svc_domain__'. $field. '_flag') ne '' ) {
105 $svc_domain->setfield($field,$part_svc->getfield('svc_domain__'. $field) );
111 $action = $svcnum ? 'Edit' : 'Add';
113 $svc = $part_svc->getfield('svc');
117 $domain = $svc_domain->domain;
120 print $cgi->header( '-expires' => 'now' ), header("$action $svc", '');
122 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
124 if $cgi->param('error');
127 <FORM ACTION="${p1}process/svc_domain.cgi" METHOD=POST>
128 <INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">
129 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">
130 <INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">
133 print qq!<INPUT TYPE="radio" NAME="action" VALUE="N"!;
134 print ' CHECKED' if $kludge_action eq 'N';
136 print qq!<BR><INPUT TYPE="radio" NAME="action" VALUE="M"!;
137 print ' CHECKED' if $kludge_action eq 'M';
141 <P>Customer agrees to be bound by NSI's
142 <A HREF="http://rs.internic.net/help/agreement.txt">
143 Domain Name Registration Agreement</A>
144 <SELECT NAME="legal" SIZE=1><OPTION SELECTED>No<OPTION>Yes</SELECT>
145 <P>Domain <INPUT TYPE="text" NAME="domain" VALUE="$domain" SIZE=28 MAXLENGTH=26>
146 <BR>Purpose/Description: <INPUT TYPE="text" NAME="purpose" VALUE="$purpose" SIZE=64>
147 <P><CENTER><INPUT TYPE="submit" VALUE="Submit"></CENTER>
149 <LI>COM is for commercial, for-profit organziations
150 <LI>ORG is for miscellaneous, usually, non-profit organizations
151 <LI>NET is for network infrastructure machines and organizations
152 <LI>EDU is for 4-year, degree granting institutions
153 <!-- <LI>GOV is for United States federal government agencies
156 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
157 and registration procedures.
158 <!-- <P>GOV registrations are limited to top-level US Federal Government agencies (see RFC 1816).