X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_domain.pm;h=9466b337cb4b7c986b9a0f51fcb50bcbe2a6f407;hb=3c54c844c665ed108c7892a154fd3972fab1f3e5;hp=3dc352b7a59005a4b76b65057e280f83201c2b29;hpb=d311f62f655dc5cad8b9319f07f8c0e6bf344cc2;p=freeside.git diff --git a/FS/FS/svc_domain.pm b/FS/FS/svc_domain.pm index 3dc352b7a..9466b337c 100644 --- a/FS/FS/svc_domain.pm +++ b/FS/FS/svc_domain.pm @@ -89,6 +89,14 @@ FS::svc_Common. The following fields are currently supported: =item max_accounts +=item au_eligibility_type + +AU-specific field for domain registrations + +=item au_registrant_name + +AU-specific field for domain registrations + =back =head1 METHODS @@ -118,6 +126,16 @@ sub table_info { disable_inventory => 1, disable_select => 1, }, + 'au_registrant_name' => { label => 'AU Registrant Name', + disable_inventory => 1, + disable_select => 1, + }, + 'au_eligibility_type' => { label => 'AU Eligibility Type', + type => 'select', + select_list => __PACKAGE__->au_eligibility_type_values, + disable_inventory => 1, + disable_select => 1, + }, 'max_accounts' => { label => 'Maximum number of accounts', 'disable_inventory' => 1, }, @@ -133,6 +151,13 @@ sub table_info { disable_inventory => 1, disable_select => 1, }, + 'cgp_certificatetype' => { + label => 'Communigate PKI services', + type => 'select', + select_list => __PACKAGE__->cgp_certificatetype_values, + disable_inventory => 1, + disable_select => 1, + }, 'acct_def_cgp_accessmodes' => { label => 'Acct. default Communigate enabled services', @@ -280,6 +305,41 @@ sub search_sql { $class->search_sql_field('domain', $string); } +=item au_eligibility_type_values + +=cut + +sub au_eligibility_type_values { + + [ '', + 'Charity', + 'Child Care Centre', + 'Citizen/Resident', + 'Club', + 'Commercial Statutory Body', + 'Company', + 'Government School', + 'Higher Education Institution', + 'Incorporated Association', + 'Industry Body', + 'National Body', + 'Non-Government School', + 'Non-profit Organisation', + 'Other', + 'Partnership', + 'Pending TM Owner', + 'Political Party', + 'Pre-school', + 'Registered Business', + 'Religious/Church Group', + 'Research Organisation', + 'Sole Trader', + 'Trade Union', + 'Trademark Owner', + 'Training Organisation', + ]; + +} =item label @@ -303,9 +363,6 @@ defined. An FS::cust_svc record will be created and inserted. The additional field I should be set to I for new domains, I for transfers, or I for no action (registered elsewhere). -A registration or transfer email will be submitted unless -$FS::svc_domain::whois_hack is true. - The additional field I can be used to manually set the admin contact email address on this email. Otherwise, the svc_acct records for this package (see L) are searched. If there is exactly one svc_acct record @@ -341,12 +398,36 @@ sub insert { local $FS::UID::AutoCommit = 0; my $dbh = dbh; - $error = $self->SUPER::insert(@_); + $error = $self->SUPER::insert(@_) + || $self->insert_defaultrecords; if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; } + $dbh->commit or die $dbh->errstr if $oldAutoCommit; + + ''; #no error +} + +=item insert_defaultrecords + +=cut + +sub insert_defaultrecords { + my $self = shift; + + local $SIG{HUP} = 'IGNORE'; + local $SIG{INT} = 'IGNORE'; + local $SIG{QUIT} = 'IGNORE'; + local $SIG{TERM} = 'IGNORE'; + local $SIG{TSTP} = 'IGNORE'; + local $SIG{PIPE} = 'IGNORE'; + + my $oldAutoCommit = $FS::UID::AutoCommit; + local $FS::UID::AutoCommit = 0; + my $dbh = dbh; + if ( $soamachine ) { my $soa = new FS::domain_record { 'svcnum' => $self->svcnum, @@ -356,10 +437,10 @@ sub insert { 'recdata' => "$soamachine $soaemail ( ". time2str("%Y%m%d", time). "00 ". "$soarefresh $soaretry $soaexpire $soadefaultttl )" }; - $error = $soa->insert; + my $error = $soa->insert; if ( $error ) { $dbh->rollback if $oldAutoCommit; - return "couldn't insert SOA record for new domain: $error"; + return "couldn't insert SOA record: $error"; } foreach my $record ( @defaultrecords ) { @@ -374,7 +455,7 @@ sub insert { my $error = $domain_record->insert; if ( $error ) { $dbh->rollback if $oldAutoCommit; - return "couldn't insert record for new domain: $error"; + return "couldn't insert record: $error"; } } @@ -495,6 +576,8 @@ sub check { #my $part_svc = $x; my $error = $self->ut_numbern('svcnum') + || $self->ut_textn('au_eligibility_type') + || $self->ut_textn('au_registrant_name') || $self->ut_numbern('catchall') || $self->ut_numbern('max_accounts') || $self->ut_anything('trailer') #well @@ -541,7 +624,7 @@ sub check { $recref->{domain} = "$1.$2"; $recref->{suffix} ||= $2; # hmmmmmmmm. - } elsif ( $whois_hack && $recref->{domain} =~ /^([\w\-\.]+)\.(\w+)$/ ) { + } elsif ( $whois_hack && $recref->{domain} =~ /^([\w\-\.\/]+)\.(\w+)$/ ) { $recref->{domain} = "$1.$2"; # need to match a list of suffixes - no guarantee they're top-level.. # http://wiki.mozilla.org/TLD_List @@ -599,6 +682,7 @@ sub domain_record { 'A' => 5, 'TXT' => 6, 'PTR' => 7, + 'SRV' => 8, ); my %sort = (