- web interface for hourly account charges!
[freeside.git] / httemplate / 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:perl@packages.debian.org">
5 </HEAD>
6
7 <BODY>
8
9 <A NAME="__index__"></A>
10 <!-- INDEX BEGIN -->
11
12 <UL>
13
14         <LI><A HREF="#name">NAME</A></LI>
15         <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
16         <LI><A HREF="#description">DESCRIPTION</A></LI>
17         <LI><A HREF="#methods">METHODS</A></LI>
18         <LI><A HREF="#version">VERSION</A></LI>
19         <LI><A HREF="#bugs">BUGS</A></LI>
20         <LI><A HREF="#see also">SEE ALSO</A></LI>
21 </UL>
22 <!-- INDEX END -->
23
24 <HR>
25 <P>
26 <H1><A NAME="name">NAME</A></H1>
27 <P>FS::svc_domain - Object methods for svc_domain records</P>
28 <P>
29 <HR>
30 <H1><A NAME="synopsis">SYNOPSIS</A></H1>
31 <PRE>
32   use FS::svc_domain;</PRE>
33 <PRE>
34   $record = new FS::svc_domain \%hash;
35   $record = new FS::svc_domain { 'column' =&gt; 'value' };</PRE>
36 <PRE>
37   $error = $record-&gt;insert;</PRE>
38 <PRE>
39   $error = $new_record-&gt;replace($old_record);</PRE>
40 <PRE>
41   $error = $record-&gt;delete;</PRE>
42 <PRE>
43   $error = $record-&gt;check;</PRE>
44 <PRE>
45   $error = $record-&gt;suspend;</PRE>
46 <PRE>
47   $error = $record-&gt;unsuspend;</PRE>
48 <PRE>
49   $error = $record-&gt;cancel;</PRE>
50 <P>
51 <HR>
52 <H1><A NAME="description">DESCRIPTION</A></H1>
53 <P>An FS::svc_domain object represents a domain.  FS::svc_domain inherits from
54 FS::svc_Common.  The following fields are currently supported:</P>
55 <DL>
56 <DT><STRONG><A NAME="item_key">svcnum - primary key (assigned automatically for new accounts)</A></STRONG><BR>
57 <DD>
58 <DT><STRONG><A NAME="item_domain">domain</A></STRONG><BR>
59 <DD>
60 <DT><STRONG><A NAME="item_catchall_%2D_optional_svcnum_of_an_svc_acct_record">catchall - optional svcnum of an svc_acct record, designating an email catchall account.</A></STRONG><BR>
61 <DD>
62 </DL>
63 <P>
64 <HR>
65 <H1><A NAME="methods">METHODS</A></H1>
66 <DL>
67 <DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><BR>
68 <DD>
69 Creates a new domain.  To add the domain to the database, see <A HREF="#insert">insert</A>.
70 <P></P>
71 <DT><STRONG><A NAME="item_insert">insert</A></STRONG><BR>
72 <DD>
73 Adds this domain to the database.  If there is an error, returns the error,
74 otherwise returns false.
75 <P>The additional fields <EM>pkgnum</EM> and <EM>svcpart</EM> (see <A HREF=".././FS/cust_svc.html">the FS::cust_svc manpage</A>) should be 
76 defined.  An FS::cust_svc record will be created and inserted.</P>
77 <P>The additional field <EM>action</EM> should be set to <EM>N</EM> for new domains or <EM>M</EM>
78 for transfers.</P>
79 <P>A registration or transfer email will be submitted unless
80 $FS::svc_domain::whois_hack is true.</P>
81 <P>The additional field <EM>email</EM> can be used to manually set the admin contact
82 email address on this email.  Otherwise, the svc_acct records for this package 
83 (see <A HREF=".././FS/cust_pkg.html">the FS::cust_pkg manpage</A>) are searched.  If there is exactly one svc_acct record
84 in the same package, it is automatically used.  Otherwise an error is returned.</P>
85 <P>If any <EM>soamachine</EM> configuration file exists, an SOA record is added to
86 the domain_record table (see &lt;FS::domain_record&gt;).</P>
87 <P>If any machines are defined in the <EM>nsmachines</EM> configuration file, NS
88 records are added to the domain_record table (see <A HREF=".././FS/domain_record.html">the FS::domain_record manpage</A>).</P>
89 <P>If any machines are defined in the <EM>mxmachines</EM> configuration file, MX
90 records are added to the domain_record table (see <A HREF=".././FS/domain_record.html">the FS::domain_record manpage</A>).</P>
91 <P>If a machine is defined in the <EM>shellmachine</EM> configuration value, the
92 <EM>qmailmachines</EM> configuration file exists, and the <EM>catchall</EM> field points
93 to an an account with a home directory (see <A HREF=".././FS/svc_acct.html">the FS::svc_acct manpage</A>), the command:</P>
94 <PRE>
95   [ -e $dir/.qmail-$qdomain-defualt ] || {
96     touch $dir/.qmail-$qdomain-default;
97     chown $uid:$gid $dir/.qmail-$qdomain-default;
98   }</PRE>
99 <P>is executed on shellmachine via ssh (see <EM>dot-qmail/``EXTENSION ADDRESSES''</EM>).
100 This behaviour can be supressed by setting $FS::svc_domain::nossh_hack true.</P>
101 <P>a machine is defined
102 in the</P>
103 <P></P>
104 <DT><STRONG><A NAME="item_delete">delete</A></STRONG><BR>
105 <DD>
106 Deletes this domain from the database.  If there is an error, returns the
107 error, otherwise returns false.
108 <P>The corresponding FS::cust_svc record will be deleted as well.</P>
109 <P></P>
110 <DT><STRONG><A NAME="item_replace_OLD_RECORD">replace OLD_RECORD</A></STRONG><BR>
111 <DD>
112 Replaces OLD_RECORD with this one in the database.  If there is an error,
113 returns the error, otherwise returns false.
114 <P></P>
115 <DT><STRONG><A NAME="item_suspend">suspend</A></STRONG><BR>
116 <DD>
117 Just returns false (no error) for now.
118 <P>Called by the suspend method of FS::cust_pkg (see <A HREF=".././FS/cust_pkg.html">the FS::cust_pkg manpage</A>).</P>
119 <P></P>
120 <DT><STRONG><A NAME="item_unsuspend">unsuspend</A></STRONG><BR>
121 <DD>
122 Just returns false (no error) for now.
123 <P>Called by the unsuspend method of FS::cust_pkg (see <A HREF=".././FS/cust_pkg.html">the FS::cust_pkg manpage</A>).</P>
124 <P></P>
125 <DT><STRONG><A NAME="item_cancel">cancel</A></STRONG><BR>
126 <DD>
127 Just returns false (no error) for now.
128 <P>Called by the cancel method of FS::cust_pkg (see <A HREF=".././FS/cust_pkg.html">the FS::cust_pkg manpage</A>).</P>
129 <P></P>
130 <DT><STRONG><A NAME="item_check">check</A></STRONG><BR>
131 <DD>
132 Checks all fields to make sure this is a valid domain.  If there is an error,
133 returns the error, otherwise returns false.  Called by the insert and replace
134 methods.
135 <P>Sets any fixed values; see <A HREF=".././FS/part_svc.html">the FS::part_svc manpage</A>.</P>
136 <P></P>
137 <DT><STRONG><A NAME="item_whois">whois</A></STRONG><BR>
138 <DD>
139 Returns the Net::Whois::Domain object (see <A HREF="../Net/Whois.html">the Net::Whois manpage</A>) for this domain, or
140 undef if the domain is not found in whois.
141 <P>(If $FS::svc_domain::whois_hack is true, returns that in all cases instead.)</P>
142 <P></P>
143 <DT><STRONG><A NAME="item__whois">_whois</A></STRONG><BR>
144 <DD>
145 Depriciated.
146 <P></P>
147 <DT><STRONG><A NAME="item_submit_internic">submit_internic</A></STRONG><BR>
148 <DD>
149 Submits a registration email for this domain.
150 <P></P></DL>
151 <P>
152 <HR>
153 <H1><A NAME="version">VERSION</A></H1>
154 <P>$Id: svc_domain.html,v 1.3 2002-01-29 17:42:46 ivan Exp $</P>
155 <P>
156 <HR>
157 <H1><A NAME="bugs">BUGS</A></H1>
158 <P>All BIND/DNS fields should be included (and exported).</P>
159 <P>Delete doesn't send a registration template.</P>
160 <P>All registries should be supported.</P>
161 <P>Should change action to a real field.</P>
162 <P>The $recref stuff in sub check should be cleaned up.</P>
163 <P>
164 <HR>
165 <H1><A NAME="see also">SEE ALSO</A></H1>
166 <P><A HREF=".././FS/svc_Common.html">the FS::svc_Common manpage</A>, <A HREF=".././FS/Record.html">the FS::Record manpage</A>, <A HREF=".././FS/Conf.html">the FS::Conf manpage</A>, <A HREF=".././FS/cust_svc.html">the FS::cust_svc manpage</A>,
167 <A HREF=".././FS/part_svc.html">the FS::part_svc manpage</A>, <A HREF=".././FS/cust_pkg.html">the FS::cust_pkg manpage</A>, <A HREF="../Net/Whois.html">the Net::Whois manpage</A>, <EM>ssh</EM>,
168 <EM>dot-qmail</EM>, schema.html from the base documentation, config.html from the
169 base documentation.</P>
170
171 </BODY>
172
173 </HTML>