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