3 # $Id: svc_domain.cgi,v 1.5 1998-12-30 23:03:25 ivan Exp $
5 # Usage: svc_domain.cgi pkgnum{pkgnum}-svcpart{svcpart}
6 # http://server.name/path/svc_domain.cgi?pkgnum{pkgnum}-svcpart{svcpart}
8 # Note: Should be run setuid freeside as user nobody
10 # ivan@voicenet.com 97-jan-5 -> 97-jan-6
12 # changes for domain template 3.5
13 # ivan@voicenet.com 97-jul-24
15 # rewrite ivan@sisd.com 98-mar-14
17 # no GOV in instructions ivan@sisd.com 98-jul-17
19 # $Log: svc_domain.cgi,v $
20 # Revision 1.5 1998-12-30 23:03:25 ivan
21 # bugfixes; fields isn't exported by derived classes
23 # Revision 1.4 1998/12/23 03:00:16 ivan
24 # $cgi->keywords instead of $cgi->query_string
26 # Revision 1.3 1998/12/17 06:17:12 ivan
27 # fix double // in relative URLs, s/CGI::Base/CGI/;
29 # Revision 1.2 1998/11/13 09:56:48 ivan
30 # change configuration file layout to support multiple distinct databases (with
31 # own set of config files, export, etc.)
36 use CGI::Carp qw(fatalsToBrowser);
37 use FS::UID qw(cgisuidsetup getotaker);
38 use FS::CGI qw(header popurl);
39 use FS::Record qw(qsearch qsearchs fields);
45 my($action,$svcnum,$svc_domain,$pkgnum,$svcpart,$part_svc);
47 my($query) = $cgi->keywords;
48 if ( $query =~ /^(\d+)$/ ) { #editing
51 $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum})
52 or die "Unknown (svc_domain) svcnum!";
54 my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
55 or die "Unknown (cust_svc) svcnum!";
57 $pkgnum=$cust_svc->pkgnum;
58 $svcpart=$cust_svc->svcpart;
60 $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
61 die "No part_svc entry!" unless $part_svc;
67 $svc_domain=create FS::svc_domain({});
69 foreach $_ (split(/-/,$query)) {
70 $pkgnum=$1 if /^pkgnum(\d+)$/;
71 $svcpart=$1 if /^svcpart(\d+)$/;
73 $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
74 die "No part_svc entry!" unless $part_svc;
78 #set fixed and default fields from part_svc
80 foreach $field ( fields('svc_domain') ) {
81 if ( $part_svc->getfield('svc_domain__'. $field. '_flag') ne '' ) {
82 $svc_domain->setfield($field,$part_svc->getfield('svc_domain__'. $field) );
90 my($svc)=$part_svc->getfield('svc');
92 my($otaker)=getotaker;
99 print $cgi->header, header("$action $svc", ''), <<END;
100 <FORM ACTION="${p1}process/svc_domain.cgi" METHOD=POST>
101 <INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">
102 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">
103 <INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">
104 <INPUT TYPE="radio" NAME="action" VALUE="N">New
105 <BR><INPUT TYPE="radio" NAME="action" VALUE="M">Transfer
107 <P>Customer agrees to be bound by NSI's
108 <A HREF="http://rs.internic.net/help/agreement.txt">
109 Domain Name Registration Agreement</A>
110 <SELECT NAME="legal" SIZE=1><OPTION SELECTED>No<OPTION>Yes</SELECT>
111 <P>Domain <INPUT TYPE="text" NAME="domain" VALUE="$domain" SIZE=28 MAXLENGTH=26>
112 <BR>Purpose/Description: <INPUT TYPE="text" NAME="purpose" VALUE="" SIZE=64>
113 <P><CENTER><INPUT TYPE="submit" VALUE="Submit"></CENTER>
115 <LI>COM is for commercial, for-profit organziations
116 <LI>ORG is for miscellaneous, usually, non-profit organizations
117 <LI>NET is for network infrastructure machines and organizations
118 <LI>EDU is for 4-year, degree granting institutions
119 <!-- <LI>GOV is for United States federal government agencies
122 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
123 and registration procedures.
124 <!-- <P>GOV registrations are limited to top-level US Federal Government agencies (see RFC 1816).