3 # $Id: svc_domain.cgi,v 1.6 1999-01-18 09:41:35 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.6 1999-01-18 09:41:35 ivan
21 # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
24 # Revision 1.5 1998/12/30 23:03:25 ivan
25 # bugfixes; fields isn't exported by derived classes
27 # Revision 1.4 1998/12/23 03:00:16 ivan
28 # $cgi->keywords instead of $cgi->query_string
30 # Revision 1.3 1998/12/17 06:17:12 ivan
31 # fix double // in relative URLs, s/CGI::Base/CGI/;
33 # Revision 1.2 1998/11/13 09:56:48 ivan
34 # change configuration file layout to support multiple distinct databases (with
35 # own set of config files, export, etc.)
40 use CGI::Carp qw(fatalsToBrowser);
41 use FS::UID qw(cgisuidsetup getotaker);
42 use FS::CGI qw(header popurl);
43 use FS::Record qw(qsearch qsearchs fields);
49 my($action,$svcnum,$svc_domain,$pkgnum,$svcpart,$part_svc);
51 my($query) = $cgi->keywords;
52 if ( $query =~ /^(\d+)$/ ) { #editing
55 $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum})
56 or die "Unknown (svc_domain) svcnum!";
58 my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
59 or die "Unknown (cust_svc) svcnum!";
61 $pkgnum=$cust_svc->pkgnum;
62 $svcpart=$cust_svc->svcpart;
64 $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
65 die "No part_svc entry!" unless $part_svc;
71 $svc_domain=create FS::svc_domain({});
73 foreach $_ (split(/-/,$query)) {
74 $pkgnum=$1 if /^pkgnum(\d+)$/;
75 $svcpart=$1 if /^svcpart(\d+)$/;
77 $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
78 die "No part_svc entry!" unless $part_svc;
82 #set fixed and default fields from part_svc
84 foreach $field ( fields('svc_domain') ) {
85 if ( $part_svc->getfield('svc_domain__'. $field. '_flag') ne '' ) {
86 $svc_domain->setfield($field,$part_svc->getfield('svc_domain__'. $field) );
94 my($svc)=$part_svc->getfield('svc');
96 my($otaker)=getotaker;
103 print $cgi->header( '-expires' => 'now' ), header("$action $svc", ''), <<END;
104 <FORM ACTION="${p1}process/svc_domain.cgi" METHOD=POST>
105 <INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">
106 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">
107 <INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">
108 <INPUT TYPE="radio" NAME="action" VALUE="N">New
109 <BR><INPUT TYPE="radio" NAME="action" VALUE="M">Transfer
111 <P>Customer agrees to be bound by NSI's
112 <A HREF="http://rs.internic.net/help/agreement.txt">
113 Domain Name Registration Agreement</A>
114 <SELECT NAME="legal" SIZE=1><OPTION SELECTED>No<OPTION>Yes</SELECT>
115 <P>Domain <INPUT TYPE="text" NAME="domain" VALUE="$domain" SIZE=28 MAXLENGTH=26>
116 <BR>Purpose/Description: <INPUT TYPE="text" NAME="purpose" VALUE="" SIZE=64>
117 <P><CENTER><INPUT TYPE="submit" VALUE="Submit"></CENTER>
119 <LI>COM is for commercial, for-profit organziations
120 <LI>ORG is for miscellaneous, usually, non-profit organizations
121 <LI>NET is for network infrastructure machines and organizations
122 <LI>EDU is for 4-year, degree granting institutions
123 <!-- <LI>GOV is for United States federal government agencies
126 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
127 and registration procedures.
128 <!-- <P>GOV registrations are limited to top-level US Federal Government agencies (see RFC 1816).