3 <TITLE>FS::svc_domain - Object methods for svc_domain records</TITLE>
4 <LINK REV="made" HREF="mailto:none">
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>
25 <H1><A NAME="NAME">NAME</A></H1>
27 FS::svc_domain - Object methods for svc_domain records
31 <H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
33 <PRE> use FS::svc_domain;
36 <PRE> $record = new FS::svc_domain \%hash;
37 $record = new FS::svc_domain { 'column' => 'value' };
40 <PRE> $error = $record->insert;
43 <PRE> $error = $new_record->replace($old_record);
46 <PRE> $error = $record->delete;
49 <PRE> $error = $record->check;
52 <PRE> $error = $record->suspend;
55 <PRE> $error = $record->unsuspend;
58 <PRE> $error = $record->cancel;
62 <H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
64 An FS::svc_domain object represents a domain. FS::svc_domain inherits from
65 FS::svc_Common. The following fields are currently supported:
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>
73 <H1><A NAME="METHODS">METHODS</A></H1>
75 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
77 Creates a new domain. To add the domain to the database, see <A HREF="#insert">insert</A>.
79 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
81 Adds this domain to the database. If there is an error, returns the error,
82 otherwise returns false.
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.
88 The additional field <EM>action</EM> should be set to <EM>N</EM> for new domains or <EM>M</EM>
92 A registration or transfer email will be submitted unless
93 $FS::svc_domain::whois_hack is true.
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.
101 If any <EM>soamachine</EM> configuration file exists, an SOA record is added to the domain_record
102 table (see <FS::domain_record>).
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>).
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>).
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.
115 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
117 Deletes this domain from the database. If there is an error, returns the
118 error, otherwise returns false.
121 The corresponding FS::cust_svc record will be deleted as well.
123 <DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
125 Replaces OLD_RECORD with this one in the database. If there is an error,
126 returns the error, otherwise returns false.
128 <DT><STRONG><A NAME="item_suspend">suspend</A></STRONG><DD>
130 Just returns false (no error) for now.
133 Called by the suspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
135 <DT><STRONG><A NAME="item_unsuspend">unsuspend</A></STRONG><DD>
137 Just returns false (no error) for now.
140 Called by the unsuspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
142 <DT><STRONG><A NAME="item_cancel">cancel</A></STRONG><DD>
144 Just returns false (no error) for now.
147 Called by the cancel method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
149 <DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
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
156 Sets any fixed values; see <A HREF="../FS/part_svc.html">FS::part_svc</A>.
158 <DT><STRONG><A NAME="item_whois">whois</A></STRONG><DD>
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.
163 (If $FS::svc_domain::whois_hack is true, returns that in all cases
166 <DT><STRONG><A NAME="item__whois">_whois</A></STRONG><DD>
170 <DT><STRONG><A NAME="item_submit_internic">submit_internic</A></STRONG><DD>
172 Submits a registration email for this domain.
177 <H1><A NAME="VERSION">VERSION</A></H1>
179 $Id: svc_domain.html,v 1.2 2000-03-03 18:22:43 ivan Exp $
183 <H1><A NAME="BUGS">BUGS</A></H1>
185 All BIND/DNS fields should be included (and exported).
188 Delete doesn't send a registration template.
191 All registries should be supported.
194 Should change action to a real field.
197 The <CODE>$recref</CODE> stuff in sub check should be cleaned up.
201 <H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
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