[freeside-commits] freeside/FS/FS Conf.pm, 1.381, 1.382 domain_record.pm, 1.22, 1.23 svc_domain.pm, 1.72, 1.73
Ivan,,,
ivan at wavetail.420.am
Tue Aug 17 10:08:24 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv13795/FS/FS
Modified Files:
Conf.pm domain_record.pm svc_domain.pm
Log Message:
DNS, RT#8933
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.381
retrieving revision 1.382
diff -u -w -d -r1.381 -r1.382
--- Conf.pm 13 Aug 2010 19:26:22 -0000 1.381
+++ Conf.pm 17 Aug 2010 17:08:22 -0000 1.382
@@ -1308,7 +1308,12 @@
'editlist_parts' => [ { type=>'text' },
{ type=>'immutable', value=>'IN' },
{ type=>'select',
- select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS TXT)} },
+ select_enum => {
+ map { $_=>$_ }
+ #@{ FS::domain_record->rectypes }
+ qw(A AAAA CNAME MX NS PTR SPF SRV TXT)
+ },
+ },
{ type=> 'text' }, ],
},
Index: domain_record.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/domain_record.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -w -d -r1.22 -r1.23
--- domain_record.pm 18 Feb 2006 02:11:44 -0000 1.22
+++ domain_record.pm 17 Aug 2010 17:08:22 -0000 1.23
@@ -419,6 +419,18 @@
or new FS::domain_record { %hash, 'recdata' => $self->zone.'.' };
}
+=item rectypes
+
+=cut
+#http://en.wikipedia.org/wiki/List_of_DNS_record_types
+#DHCID? other things?
+sub rectypes {
+ [ qw(A AAAA CNAME MX NS PTR SPF SRV TXT), #most common types
+ #qw(DNAME), #uncommon types
+ qw(DLV DNSKEY DS NSEC NSEC3 NSEC3PARAM RRSIG), #DNSSEC types
+ ];
+}
+
=back
=head1 BUGS
Index: svc_domain.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_domain.pm,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -w -d -r1.72 -r1.73
--- svc_domain.pm 6 Aug 2010 21:28:08 -0000 1.72
+++ svc_domain.pm 17 Aug 2010 17:08:22 -0000 1.73
@@ -341,12 +341,36 @@
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 +380,10 @@
'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 +398,7 @@
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";
}
}
More information about the freeside-commits
mailing list