RT#34289: Flag service fields as mandatory
[freeside.git] / FS / FS / svc_domain.pm
1 package FS::svc_domain;
2
3 use strict;
4 use base qw( FS::svc_Parent_Mixin FS::svc_CGP_Mixin FS::svc_CGPRule_Mixin
5              FS::svc_Common );
6 use vars qw( $whois_hack $conf
7   @defaultrecords $soadefaultttl $soaemail $soaexpire $soamachine
8   $soarefresh $soaretry
9 );
10 use Carp;
11 use Scalar::Util qw( blessed );
12 use Date::Format;
13 #use Net::Whois::Raw;
14 use Net::Domain::TLD qw(tld_exists);
15 use FS::Record qw(fields qsearch qsearchs dbh);
16 use FS::Conf;
17 use FS::cust_svc;
18 use FS::svc_acct;
19 use FS::cust_pkg;
20 use FS::cust_main;
21 use FS::domain_record;
22 use FS::queue;
23
24 #ask FS::UID to run this stuff for us later
25 $FS::UID::callback{'FS::domain'} = sub { 
26   $conf = new FS::Conf;
27
28   @defaultrecords = $conf->config('defaultrecords');
29   $soadefaultttl = $conf->config('soadefaultttl');
30   $soaemail      = $conf->config('soaemail');
31   $soaexpire     = $conf->config('soaexpire');
32   $soamachine    = $conf->config('soamachine');
33   $soarefresh    = $conf->config('soarefresh');
34   $soaretry      = $conf->config('soaretry');
35
36 };
37
38 =head1 NAME
39
40 FS::svc_domain - Object methods for svc_domain records
41
42 =head1 SYNOPSIS
43
44   use FS::svc_domain;
45
46   $record = new FS::svc_domain \%hash;
47   $record = new FS::svc_domain { 'column' => 'value' };
48
49   $error = $record->insert;
50
51   $error = $new_record->replace($old_record);
52
53   $error = $record->delete;
54
55   $error = $record->check;
56
57   $error = $record->suspend;
58
59   $error = $record->unsuspend;
60
61   $error = $record->cancel;
62
63 =head1 DESCRIPTION
64
65 An FS::svc_domain object represents a domain.  FS::svc_domain inherits from
66 FS::svc_Common.  The following fields are currently supported:
67
68 =over 4
69
70 =item svcnum
71
72 primary key (assigned automatically for new accounts)
73
74 =item domain
75
76 =item catchall
77
78 optional svcnum of an svc_acct record, designating an email catchall account.
79
80 =item suffix
81
82 =item parent_svcnum
83
84 =item quota
85
86 Storage limit
87
88 =item registrarnum
89
90 Registrar (see L<FS::registrar>)
91
92 =item registrarkey
93
94 Registrar key or password for this domain
95
96 =item setup_date
97
98 UNIX timestamp
99
100 =item renewal_interval
101
102 Number of days before expiration date to start renewal
103
104 =item expiration_date
105
106 UNIX timestamp
107
108 =item max_accounts
109
110 =item au_eligibility_type
111
112 AU-specific field for domain registrations
113
114 =item au_registrant_name
115
116 AU-specific field for domain registrations
117
118 =back
119
120 =head1 METHODS
121
122 =over 4
123
124 =item new HASHREF
125
126 Creates a new domain.  To add the domain to the database, see L<"insert">.
127
128 =cut
129
130 sub table_info {
131   {
132     'name' => 'Domain',
133     'sorts' => 'domain',
134     'display_weight' => 20,
135     'cancel_weight'  => 60,
136     'fields' => {
137       'domain' => {
138                   label => 'Domain',
139                   required => 1,
140                 },
141       'parent_svcnum' => { 
142                          label => 'Parent domain / Communigate administrator domain',
143                          type  => 'select',
144                          select_table => 'svc_domain',
145                          select_key => 'svcnum',
146                          select_label => 'domain',
147                          disable_inventory => 1,
148                          disable_select    => 1,
149                        },
150       'au_registrant_name' => { label => 'AU Registrant Name',
151                                 disable_inventory => 1,
152                                 disable_select => 1,
153                               },
154       'au_eligibility_type' => { label => 'AU Eligibility Type',
155                              type  => 'select',
156                              select_list => __PACKAGE__->au_eligibility_type_values,
157                              disable_inventory => 1,
158                              disable_select    => 1,
159                               },
160       'max_accounts' => { label => 'Maximum number of accounts',
161                           'disable_inventory' => 1,
162                         },
163       'quota'     => { 
164                          label => 'Quota', #storage limit
165                          type  => 'text',
166                          disable_inventory => 1,
167                      },
168       'cgp_aliases' => { 
169                          label => 'Communigate aliases',
170                          type  => 'text',
171                          disable_inventory => 1,
172                          disable_select    => 1,
173                        },
174       'cgp_accessmodes' => { 
175                              label => 'Communigate enabled services',
176                              type  => 'communigate_pro-accessmodes',
177                              disable_inventory => 1,
178                              disable_select    => 1,
179                            },
180       'cgp_certificatetype' => { 
181                              label => 'Communigate PKI services',
182                              type  => 'select',
183                              select_list => __PACKAGE__->cgp_certificatetype_values,
184                              disable_inventory => 1,
185                              disable_select    => 1,
186                            },
187
188       'acct_def_cgp_accessmodes' => { 
189                              label => 'Acct. default Communigate enabled services',
190                              type  => 'communigate_pro-accessmodes',
191                              disable_inventory => 1,
192                              disable_select    => 1,
193                            },
194       'acct_def_password_selfchange' => { label => 'Acct. default Password modification',
195                                  type  => 'checkbox',
196                             disable_inventory => 1,
197                             disable_select    => 1,
198                                },
199       'acct_def_password_recover'    => { label => 'Acct. default Password recovery',
200                                  type  => 'checkbox',
201                             disable_inventory => 1,
202                             disable_select    => 1,
203                                },
204       'acct_def_cgp_deletemode' => { 
205                             label => 'Acct. default Communigate message delete method',
206                             type  => 'select',
207                             select_list => [ 'Move To Trash', 'Immediately', 'Mark' ],
208                             disable_inventory => 1,
209                             disable_select    => 1,
210                           },
211       'acct_def_cgp_emptytrash' => { 
212                             label => 'Acct. default Communigate on logout remove trash',
213                             type        => 'select',
214                             select_list => __PACKAGE__->cgp_emptytrash_values,
215                             disable_inventory => 1,
216                             disable_select    => 1,
217                           },
218       'acct_def_quota'     => { 
219                        label => 'Acct. default Quota', #Mail storage limit
220                        type => 'text',
221                        disable_inventory => 1,
222                        disable_select => 1,
223                      },
224       'acct_def_file_quota'=> { 
225                        label => 'Acct. default File storage limit',
226                        type => 'text',
227                        disable_inventory => 1,
228                        disable_select => 1,
229                      },
230       'acct_def_file_maxnum'=> { 
231                        label => 'Acct. default Number of files limit',
232                        type => 'text',
233                        disable_inventory => 1,
234                        disable_select => 1,
235                      },
236       'acct_def_file_maxsize'=> { 
237                        label => 'Acct. default File size limit',
238                        type => 'text',
239                        disable_inventory => 1,
240                        disable_select => 1,
241                      },
242       'acct_def_cgp_rulesallowed'   => {
243         label       => 'Acct. default Allowed mail rules',
244         type        => 'select',
245         select_list => [ '', 'No', 'Filter Only', 'All But Exec', 'Any' ],
246         disable_inventory => 1,
247         disable_select    => 1,
248       },
249       'acct_def_cgp_rpopallowed'    => {
250         label => 'Acct. default RPOP modifications',
251         type  => 'checkbox',
252       },
253       'acct_def_cgp_mailtoall'      => {
254         label => 'Acct. default Accepts mail to "all"',
255         type  => 'checkbox',
256       },
257       'acct_def_cgp_addmailtrailer' => {
258         label => 'Acct. default Add trailer to sent mail',
259         type  => 'checkbox',
260       },
261       'acct_def_cgp_archiveafter'   => {
262         label       => 'Archive messages after',
263         type        => 'select',
264         select_hash => [ 
265                          -2 => 'default(730 days)',
266                          0 => 'Never',
267                          86400 => '24 hours',
268                          172800 => '2 days',
269                          259200 => '3 days',
270                          432000 => '5 days',
271                          604800 => '7 days',
272                          1209600 => '2 weeks',
273                          2592000 => '30 days',
274                          7776000 => '90 days',
275                          15552000 => '180 days',
276                          31536000 => '365 days',
277                          63072000 => '730 days',
278                        ],
279         disable_inventory => 1,
280         disable_select    => 1,
281       },
282       'trailer' => {
283         label => 'Mail trailer',
284         type  => 'textarea',
285         disable_inventory => 1,
286         disable_select    => 1,
287       },
288       'acct_def_cgp_language' => {
289                             label => 'Acct. default language',
290                             type  => 'select',
291                             select_list => [ '', qw( English Arabic Chinese Dutch French German Hebrew Italian Japanese Portuguese Russian Slovak Spanish Thai ) ],
292                             disable_inventory => 1,
293                             disable_select    => 1,
294                         },
295       'acct_def_cgp_timezone' => {
296                             label       => 'Acct. default time zone',
297                             type        => 'select',
298                             select_list => __PACKAGE__->cgp_timezone_values,
299                             disable_inventory => 1,
300                             disable_select    => 1,
301                         },
302       'acct_def_cgp_skinname' => {
303                             label => 'Acct. default layout',
304                             type  => 'select',
305                             select_list => [ '', '***', 'GoldFleece', 'Skin2' ],
306                             disable_inventory => 1,
307                             disable_select    => 1,
308                         },
309       'acct_def_cgp_prontoskinname' => {
310                             label => 'Acct. default Pronto style',
311                             type  => 'select',
312                             select_list => [ '', 'Pronto', 'Pronto-darkflame', 'Pronto-steel', 'Pronto-twilight', ],
313                             disable_inventory => 1,
314                             disable_select    => 1,
315                         },
316       'acct_def_cgp_sendmdnmode' => {
317         label => 'Acct. default send read receipts',
318         type  => 'select',
319         select_list => [ '', 'Never', 'Manually', 'Automatically' ],
320         disable_inventory => 1,
321         disable_select    => 1,
322       },
323     },
324   };
325 }
326
327 sub table { 'svc_domain'; }
328
329 sub search_sql {
330   my($class, $string) = @_;
331   $class->search_sql_field('domain', $string);
332 }
333
334 =item au_eligibility_type_values
335
336 =cut
337
338 sub au_eligibility_type_values {
339
340  [ '',
341    'Charity',
342    'Child Care Centre',
343    'Citizen/Resident',
344    'Club',
345    'Commercial Statutory Body',
346    'Company',
347    'Government School',
348    'Higher Education Institution',
349    'Incorporated Association',
350    'Industry Body',
351    'National Body',
352    'Non-Government School',
353    'Non-profit Organisation',
354    'Other',
355    'Partnership',
356    'Pending TM Owner',
357    'Political Party',
358    'Pre-school',
359    'Registered Business',
360    'Religious/Church Group',
361    'Research Organisation',
362    'Sole Trader',
363    'Trade Union',
364    'Trademark Owner',
365    'Training Organisation',
366   ];
367
368 }
369
370 =item label
371
372 Returns the domain.
373
374 =cut
375
376 sub label {
377   my $self = shift;
378   $self->domain;
379 }
380
381 =item insert [ , OPTION => VALUE ... ]
382
383 Adds this domain to the database.  If there is an error, returns the error,
384 otherwise returns false.
385
386 The additional fields I<pkgnum> and I<svcpart> (see L<FS::cust_svc>) should be 
387 defined.  An FS::cust_svc record will be created and inserted.
388
389 The additional field I<action> should be set to I<N> for new domains, I<M>
390 for transfers, or I<I> for no action (registered elsewhere).
391
392 The additional field I<email> can be used to manually set the admin contact
393 email address on this email.  Otherwise, the svc_acct records for this package 
394 (see L<FS::cust_pkg>) are searched.  If there is exactly one svc_acct record
395 in the same package, it is automatically used.  Otherwise an error is returned.
396
397 If any I<soamachine> configuration file exists, an SOA record is added to
398 the domain_record table (see <FS::domain_record>).
399
400 If any records are defined in the I<defaultrecords> configuration file,
401 appropriate records are added to the domain_record table (see
402 L<FS::domain_record>).
403
404 Currently available options are: I<depend_jobnum>
405
406 If I<depend_jobnum> is set (to a scalar jobnum or an array reference of
407 jobnums), all provisioning jobs will have a dependancy on the supplied
408 jobnum(s) (they will not run until the specific job(s) complete(s)).
409
410 =cut
411
412 sub insert {
413   my $self = shift;
414   my $error;
415
416   local $SIG{HUP} = 'IGNORE';
417   local $SIG{INT} = 'IGNORE';
418   local $SIG{QUIT} = 'IGNORE';
419   local $SIG{TERM} = 'IGNORE';
420   local $SIG{TSTP} = 'IGNORE';
421   local $SIG{PIPE} = 'IGNORE';
422
423   my $oldAutoCommit = $FS::UID::AutoCommit;
424   local $FS::UID::AutoCommit = 0;
425   my $dbh = dbh;
426
427   $error =  $self->SUPER::insert(@_)
428          || $self->insert_defaultrecords;
429   if ( $error ) {
430     $dbh->rollback if $oldAutoCommit;
431     return $error;
432   }
433
434   $dbh->commit or die $dbh->errstr if $oldAutoCommit;
435
436   ''; #no error
437 }
438
439 =item insert_defaultrecords
440
441 =cut
442
443 sub insert_defaultrecords {
444   my $self = shift;
445
446   local $SIG{HUP} = 'IGNORE';
447   local $SIG{INT} = 'IGNORE';
448   local $SIG{QUIT} = 'IGNORE';
449   local $SIG{TERM} = 'IGNORE';
450   local $SIG{TSTP} = 'IGNORE';
451   local $SIG{PIPE} = 'IGNORE';
452
453   my $oldAutoCommit = $FS::UID::AutoCommit;
454   local $FS::UID::AutoCommit = 0;
455   my $dbh = dbh;
456
457   if ( $soamachine ) {
458     my $soa = new FS::domain_record {
459       'svcnum'  => $self->svcnum,
460       'reczone' => '@',
461       'recaf'   => 'IN',
462       'rectype' => 'SOA',
463       'recdata' => "$soamachine $soaemail ( ". time2str("%Y%m%d", time). "00 ".
464                    "$soarefresh $soaretry $soaexpire $soadefaultttl )"
465     };
466     my $error = $soa->insert;
467     if ( $error ) {
468       $dbh->rollback if $oldAutoCommit;
469       return "couldn't insert SOA record: $error";
470     }
471
472     foreach my $record ( @defaultrecords ) {
473       my($zone,$af,$type,$data) = split(/\s+/,$record,4);
474       my $domain_record = new FS::domain_record {
475         'svcnum'  => $self->svcnum,
476         'reczone' => $zone,
477         'recaf'   => $af,
478         'rectype' => $type,
479         'recdata' => $data,
480       };
481       my $error = $domain_record->insert;
482       if ( $error ) {
483         $dbh->rollback if $oldAutoCommit;
484         return "couldn't insert record: $error";
485       }
486     }
487
488   }
489
490   $dbh->commit or die $dbh->errstr if $oldAutoCommit;
491
492   ''; #no error
493 }
494
495 =item delete
496
497 Deletes this domain from the database.  If there is an error, returns the
498 error, otherwise returns false.
499
500 The corresponding FS::cust_svc record will be deleted as well.
501
502 =cut
503
504 sub delete {
505   my $self = shift;
506
507   return "Can't delete a domain which has accounts!"
508     if qsearch( 'svc_acct', { 'domsvc' => $self->svcnum } );
509
510   #return "Can't delete a domain with (domain_record) zone entries!"
511   #  if qsearch('domain_record', { 'svcnum' => $self->svcnum } );
512
513   local $SIG{HUP} = 'IGNORE';
514   local $SIG{INT} = 'IGNORE';
515   local $SIG{QUIT} = 'IGNORE';
516   local $SIG{TERM} = 'IGNORE';
517   local $SIG{TSTP} = 'IGNORE';
518   local $SIG{PIPE} = 'IGNORE';
519
520   my $oldAutoCommit = $FS::UID::AutoCommit;
521   local $FS::UID::AutoCommit = 0;
522   my $dbh = dbh;
523
524   foreach my $domain_record ( reverse $self->domain_record ) {
525     my $error = $domain_record->delete;
526     if ( $error ) {
527       $dbh->rollback if $oldAutoCommit;
528       return "can't delete DNS entry: ".
529              join(' ', map $domain_record->$_(),
530                            qw( reczone recaf rectype recdata )
531                  ).
532              ":$error";
533     }
534   }
535
536   my $error = $self->SUPER::delete(@_);
537   if ( $error ) {
538     $dbh->rollback if $oldAutoCommit;
539     return $error;
540   }
541
542   $dbh->commit or die $dbh->errstr if $oldAutoCommit;
543 }
544
545 =item replace OLD_RECORD
546
547 Replaces OLD_RECORD with this one in the database.  If there is an error,
548 returns the error, otherwise returns false.
549
550 =cut
551
552 sub replace {
553   my $new = shift;
554
555   my $old = ( blessed($_[0]) && $_[0]->isa('FS::Record') )
556               ? shift
557               : $new->replace_old;
558
559   return "Can't change domain - reorder."
560     if $old->getfield('domain') ne $new->getfield('domain')
561     && ! $conf->exists('svc_domain-edit_domain'); 
562
563   # Better to do it here than to force the caller to remember that svc_domain is weird.
564   $new->setfield(action => 'I');
565   my $error = $new->SUPER::replace($old, @_);
566   return $error if $error;
567 }
568
569 =item suspend
570
571 Just returns false (no error) for now.
572
573 Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
574
575 =item unsuspend
576
577 Just returns false (no error) for now.
578
579 Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
580
581 =item cancel
582
583 Just returns false (no error) for now.
584
585 Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
586
587 =item check
588
589 Checks all fields to make sure this is a valid domain.  If there is an error,
590 returns the error, otherwise returns false.  Called by the insert and replace
591 methods.
592
593 Sets any fixed values; see L<FS::part_svc>.
594
595 =cut
596
597 sub check {
598   my $self = shift;
599
600   my $x = $self->setfixed;
601   return $x unless ref($x);
602   #my $part_svc = $x;
603
604   my $error = $self->ut_numbern('svcnum')
605               || $self->ut_textn('au_eligibility_type')
606               || $self->ut_textn('au_registrant_name')
607               || $self->ut_numbern('catchall')
608               || $self->ut_numbern('max_accounts')
609               || $self->ut_alphan('quota')
610               || $self->ut_anything('trailer') #well
611               || $self->ut_textn('cgp_aliases') #well
612               || $self->ut_enum('acct_def_password_selfchange', [ '', 'Y' ])
613               || $self->ut_enum('acct_def_password_recover',    [ '', 'Y' ])
614               || $self->ut_textn('acct_def_cgp_accessmodes')
615               || $self->ut_alphan('acct_def_quota')
616               || $self->ut_alphan('acct_def_file_quota')
617               || $self->ut_alphan('acct_def_maxnum')
618               || $self->ut_alphan('acct_def_maxsize')
619               #settings
620               || $self->ut_alphasn('acct_def_cgp_rulesallowed')
621               || $self->ut_enum('acct_def_cgp_rpopallowed', [ '', 'Y' ])
622               || $self->ut_enum('acct_def_cgp_mailtoall', [ '', 'Y' ])
623               || $self->ut_enum('acct_def_cgp_addmailtrailer', [ '', 'Y' ])
624               || $self->ut_snumbern('acct_def_cgp_archiveafter')
625               #preferences
626               || $self->ut_alphasn('acct_def_cgp_deletemode')
627               || $self->ut_enum('acct_def_cgp_emptytrash',
628                                    $self->cgp_emptytrash_values )
629               || $self->ut_alphan('acct_def_cgp_language')
630               || $self->ut_textn('acct_def_cgp_timezone')
631               || $self->ut_textn('acct_def_cgp_skinname')
632               || $self->ut_textn('acct_def_cgp_prontoskinname')
633               || $self->ut_alphan('acct_def_cgp_sendmdnmode')
634               #mail
635   ;
636   return $error if $error;
637
638   #hmm
639   my $pkgnum;
640   if ( $self->svcnum ) {
641     my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $self->svcnum } );
642     $pkgnum = $cust_svc->pkgnum;
643   } else {
644     $pkgnum = $self->pkgnum;
645   }
646
647   my($recref) = $self->hashref;
648
649   #if ( $recref->{domain} =~ /^([\w\-\.]{1,22})\.(com|net|org|edu)$/ ) {
650   if ( $recref->{domain} =~ /^([\w\-]{1,63})\.(com|net|org|edu|tv|info|biz)$/ ) {
651     $recref->{domain} = "$1.$2";
652     $recref->{suffix} ||= $2;
653   # hmmmmmmmm.
654   } elsif ( $whois_hack && $recref->{domain} =~ /^([\w\-\.\/]+)\.(\w+)$/ ) {
655     $recref->{domain} = "$1.$2";
656     # need to match a list of suffixes - no guarantee they're top-level..
657     # http://wiki.mozilla.org/TLD_List
658     # but this will have to do for now...
659     $recref->{suffix} ||= $2;
660   } else {
661     return "Illegal domain ". $recref->{domain}.
662            " (or unknown registry - try \$whois_hack)";
663   }
664
665   $self->suffix =~ /(^|\.)(\w+)$/
666     or return "can't parse suffix for TLD: ". $self->suffix;
667   my $tld = $2;
668   return "No such TLD: .$tld" unless tld_exists($tld);
669
670   if ( $recref->{catchall} ne '' ) {
671     my $svc_acct = qsearchs( 'svc_acct', { 'svcnum' => $recref->{catchall} } );
672     return "Unknown catchall" unless $svc_acct;
673   }
674
675   $self->ut_alphan('suffix')
676     or $self->ut_foreign_keyn('registrarnum', 'registrar', 'registrarnum')
677     or $self->ut_textn('registrarkey')
678     or $self->ut_numbern('setup_date')
679     or $self->ut_numbern('renewal_interval')
680     or $self->ut_numbern('expiration_date')
681     or $self->SUPER::check;
682
683 }
684
685 sub _check_duplicate {
686   my $self = shift;
687
688   $self->lock_table;
689
690   if ( qsearchs( 'svc_domain', { 'domain' => $self->domain } ) ) {
691     return "Domain in use (here)";
692   } else {
693     return '';
694   }
695 }
696
697 =item domain_record
698
699 =cut
700
701 sub domain_record {
702   my $self = shift;
703
704   my %order = (
705     'SOA'   => 1,
706     'NS'    => 2,
707     'MX'    => 3,
708     'CNAME' => 4,
709     'A'     => 5,
710     'TXT'   => 6,
711     'PTR'   => 7,
712     'SRV'   => 8,
713   );
714
715   my %sort = (
716     #'SOA'   => sub { $_[0]->recdata cmp $_[1]->recdata }, #sure hope not though
717 #    'SOA'   => sub { 0; },
718 #    'NS'    => sub { 0; },
719     'MX'    => sub { my( $a_weight, $a_name ) = split(/\s+/, $_[0]->recdata);
720                      my( $b_weight, $b_name ) = split(/\s+/, $_[1]->recdata);
721                      $a_weight <=> $b_weight or $a_name cmp $b_name;
722                    },
723     'CNAME' => sub { $_[0]->reczone cmp $_[1]->reczone },
724     'A'     => sub { $_[0]->reczone cmp $_[1]->reczone },
725
726 #    'TXT'   => sub { 0; },
727     'PTR'   => sub { $_[0]->reczone <=> $_[1]->reczone },
728   );
729
730   map { $_ } #return $self->num_domain_record( PARAMS ) unless wantarray;
731   sort {    $order{$a->rectype} <=> $order{$b->rectype}
732          or &{ $sort{$a->rectype} || sub { 0; } }($a, $b)
733        }
734        qsearch('domain_record', { svcnum => $self->svcnum } );
735
736 }
737
738 sub catchall_svc_acct {
739   my $self = shift;
740   if ( $self->catchall ) {
741     qsearchs( 'svc_acct', { 'svcnum' => $self->catchall } );
742   } else {
743     '';
744   }
745 }
746
747 =item whois
748
749 # Returns the Net::Whois::Domain object (see L<Net::Whois>) for this domain, or
750 # undef if the domain is not found in whois.
751
752 (If $FS::svc_domain::whois_hack is true, returns that in all cases instead.)
753
754 =cut
755
756 sub whois {
757   #$whois_hack or new Net::Whois::Domain $_[0]->domain;
758   #$whois_hack or die "whois_hack not set...\n";
759 }
760
761 =back
762
763 =head1 BUGS
764
765 Delete doesn't send a registration template.
766
767 All registries should be supported.
768
769 Should change action to a real field.
770
771 The $recref stuff in sub check should be cleaned up.
772
773 =head1 SEE ALSO
774
775 L<FS::svc_Common>, L<FS::Record>, L<FS::Conf>, L<FS::cust_svc>,
776 L<FS::part_svc>, L<FS::cust_pkg>, L<Net::Whois>, schema.html from the base
777 documentation, config.html from the base documentation.
778
779 =cut
780
781 1;
782
783