"shouldn't hurt" (famous last words)
[freeside.git] / htdocs / docs / man / FS / svc_domain.html
1 <HTML>
2 <HEAD>
3 <TITLE>FS::svc_domain - Object methods for svc_domain records</TITLE>
4 <LINK REV="made" HREF="mailto:none">
5 </HEAD>
6
7 <BODY>
8
9 <!-- INDEX BEGIN -->
10
11 <UL>
12
13         <LI><A HREF="#NAME">NAME</A>
14         <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
15         <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
16         <LI><A HREF="#METHODS">METHODS</A>
17         <LI><A HREF="#VERSION">VERSION</A>
18         <LI><A HREF="#BUGS">BUGS</A>
19         <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
20 </UL>
21 <!-- INDEX END -->
22
23 <HR>
24 <P>
25 <H1><A NAME="NAME">NAME</A></H1>
26 <P>
27 FS::svc_domain - Object methods for svc_domain records
28
29 <P>
30 <HR>
31 <H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
32 <P>
33 <PRE>  use FS::svc_domain;
34 </PRE>
35 <P>
36 <PRE>  $record = new FS::svc_domain \%hash;
37   $record = new FS::svc_domain { 'column' =&gt; 'value' };
38 </PRE>
39 <P>
40 <PRE>  $error = $record-&gt;insert;
41 </PRE>
42 <P>
43 <PRE>  $error = $new_record-&gt;replace($old_record);
44 </PRE>
45 <P>
46 <PRE>  $error = $record-&gt;delete;
47 </PRE>
48 <P>
49 <PRE>  $error = $record-&gt;check;
50 </PRE>
51 <P>
52 <PRE>  $error = $record-&gt;suspend;
53 </PRE>
54 <P>
55 <PRE>  $error = $record-&gt;unsuspend;
56 </PRE>
57 <P>
58 <PRE>  $error = $record-&gt;cancel;
59 </PRE>
60 <P>
61 <HR>
62 <H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
63 <P>
64 An FS::svc_domain object represents a domain. FS::svc_domain inherits from
65 FS::svc_Common. The following fields are currently supported:
66
67 <DL>
68 <DT><STRONG><A NAME="item_svcnum">svcnum - primary key (assigned automatically for new accounts)</A></STRONG><DD>
69 <DT><STRONG><A NAME="item_domain">domain</A></STRONG><DD>
70 </DL>
71 <P>
72 <HR>
73 <H1><A NAME="METHODS">METHODS</A></H1>
74 <DL>
75 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
76 <P>
77 Creates a new domain. To add the domain to the database, see <A HREF="#insert">insert</A>.
78
79 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
80 <P>
81 Adds this domain to the database. If there is an error, returns the error,
82 otherwise returns false.
83
84 <P>
85 The additional fields <EM>pkgnum</EM> and <EM>svcpart</EM> (see <A HREF="../FS/cust_svc.html">FS::cust_svc</A>) should be defined. An FS::cust_svc record will be created and inserted.
86
87 <P>
88 The additional field <EM>action</EM> should be set to <EM>N</EM> for new domains or <EM>M</EM>
89 for transfers.
90
91 <P>
92 A registration or transfer email will be submitted unless
93 $FS::svc_domain::whois_hack is true.
94
95 <P>
96 The additional field <EM>email</EM> can be used to manually set the admin contact email address on this email.
97 Otherwise, the svc_acct records for this package (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>) are searched. If there is exactly one svc_acct record in the same
98 package, it is automatically used. Otherwise an error is returned.
99
100 <P>
101 If any <EM>soamachine</EM> configuration file exists, an SOA record is added to the domain_record
102 table (see &lt;FS::domain_record&gt;).
103
104 <P>
105 If any machines are defined in the <EM>nsmachines</EM> configuration file, NS records are added to the domain_record table (see <A HREF="../FS/domain_record.html">FS::domain_record</A>).
106
107 <P>
108 If any machines are defined in the <EM>mxmachines</EM> configuration file, MX records are added to the domain_record table (see <A HREF="../FS/domain_record.html">FS::domain_record</A>).
109
110 <P>
111 Any problems adding FS::domain_record records will emit warnings, but will
112 not return errors from this method. If your configuration files are correct
113 you shouln't have any problems.
114
115 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
116 <P>
117 Deletes this domain from the database. If there is an error, returns the
118 error, otherwise returns false.
119
120 <P>
121 The corresponding FS::cust_svc record will be deleted as well.
122
123 <DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
124 <P>
125 Replaces OLD_RECORD with this one in the database. If there is an error,
126 returns the error, otherwise returns false.
127
128 <DT><STRONG><A NAME="item_suspend">suspend</A></STRONG><DD>
129 <P>
130 Just returns false (no error) for now.
131
132 <P>
133 Called by the suspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
134
135 <DT><STRONG><A NAME="item_unsuspend">unsuspend</A></STRONG><DD>
136 <P>
137 Just returns false (no error) for now.
138
139 <P>
140 Called by the unsuspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
141
142 <DT><STRONG><A NAME="item_cancel">cancel</A></STRONG><DD>
143 <P>
144 Just returns false (no error) for now.
145
146 <P>
147 Called by the cancel method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
148
149 <DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
150 <P>
151 Checks all fields to make sure this is a valid domain. If there is an
152 error, returns the error, otherwise returns false. Called by the insert and
153 replace methods.
154
155 <P>
156 Sets any fixed values; see <A HREF="../FS/part_svc.html">FS::part_svc</A>.
157
158 <DT><STRONG><A NAME="item_whois">whois</A></STRONG><DD>
159 <P>
160 Returns the Net::Whois::Domain object (see <A HREF="../Net/Whois.html">Net::Whois</A>) for this domain, or undef if the domain is not found in whois.
161
162 <P>
163 (If $FS::svc_domain::whois_hack is true, returns that in all cases
164 instead.)
165
166 <DT><STRONG><A NAME="item__whois">_whois</A></STRONG><DD>
167 <P>
168 Depriciated.
169
170 <DT><STRONG><A NAME="item_submit_internic">submit_internic</A></STRONG><DD>
171 <P>
172 Submits a registration email for this domain.
173
174 </DL>
175 <P>
176 <HR>
177 <H1><A NAME="VERSION">VERSION</A></H1>
178 <P>
179 $Id: svc_domain.html,v 1.2 2000-03-03 18:22:43 ivan Exp $
180
181 <P>
182 <HR>
183 <H1><A NAME="BUGS">BUGS</A></H1>
184 <P>
185 All BIND/DNS fields should be included (and exported).
186
187 <P>
188 Delete doesn't send a registration template.
189
190 <P>
191 All registries should be supported.
192
193 <P>
194 Should change action to a real field.
195
196 <P>
197 The <CODE>$recref</CODE> stuff in sub check should be cleaned up.
198
199 <P>
200 <HR>
201 <H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
202 <P>
203 <A HREF="../FS/svc_Common.html">FS::svc_Common</A>, <A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/Conf.html">FS::Conf</A>, <A HREF="../FS/cust_svc.html">FS::cust_svc</A>,
204 <A HREF="../FS/part_svc.html">FS::part_svc</A>, <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>, <A HREF="../FS/SSH.html">FS::SSH</A>, <A HREF="../Net/Whois.html">Net::Whois</A>, <EM>ssh</EM>,
205 <EM>dot-qmail</EM>, schema.html from the base documentation, config.html from the base
206 documentation.
207
208 </BODY>
209
210 </HTML>