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