[freeside-commits] freeside/FS/FS svc_domain.pm, 1.56.2.16, 1.56.2.17 domain_record.pm, 1.22, 1.22.6.1 Schema.pm, 1.168.2.48, 1.168.2.49
Ivan,,,
ivan at wavetail.420.am
Sat Sep 11 10:03:01 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv5699/FS/FS
Modified Files:
Tag: FREESIDE_1_9_BRANCH
svc_domain.pm domain_record.pm Schema.pm
Log Message:
dns updates from Erik L: add ttl support, add check for SRV and finish allowing additional rectypes, allow forward slashes for RFC2317 classless in-arpa delegation, RT#8933
Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.168.2.48
retrieving revision 1.168.2.49
diff -u -w -d -r1.168.2.48 -r1.168.2.49
--- Schema.pm 17 Aug 2010 06:43:07 -0000 1.168.2.48
+++ Schema.pm 11 Sep 2010 17:02:59 -0000 1.168.2.49
@@ -1628,6 +1628,7 @@
'recaf', 'char', '', 2, '', '',
'rectype', 'varchar', '', 5, '', '',
'recdata', 'varchar', '', 255, '', '',
+ 'ttl', 'int', 'NULL', '', '', '',
],
'primary_key' => 'recnum',
'unique' => [],
Index: domain_record.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/domain_record.pm,v
retrieving revision 1.22
retrieving revision 1.22.6.1
diff -u -w -d -r1.22 -r1.22.6.1
--- domain_record.pm 18 Feb 2006 02:11:44 -0000 1.22
+++ domain_record.pm 11 Sep 2010 17:02:59 -0000 1.22.6.1
@@ -1,7 +1,7 @@
package FS::domain_record;
use strict;
-use vars qw( @ISA $noserial_hack $DEBUG );
+use vars qw( @ISA $noserial_hack $DEBUG $me );
use FS::Conf;
#use FS::Record qw( qsearch qsearchs );
use FS::Record qw( qsearchs dbh );
@@ -11,6 +11,7 @@
@ISA = qw(FS::Record);
$DEBUG = 0;
+$me = '[FS::domain_record]';
=head1 NAME
@@ -51,6 +52,8 @@
=item recdata - data for this entry
+=item ttl - time to live
+
=back
=head1 METHODS
@@ -265,10 +268,12 @@
$self->recaf =~ /^(IN)$/ or return "Illegal recaf: ". $self->recaf;
$self->recaf($1);
- $self->rectype =~ /^(SOA|NS|MX|A|PTR|CNAME|TXT|_mstr)$/
- or return "Illegal rectype (only SOA NS MX A PTR CNAME TXT recognized): ".
- $self->rectype;
- $self->rectype($1);
+ $self->ttl =~ /^([0-9]{0,6})$/ or return "Illegal ttl: ". $self->ttl;
+ $self->ttl($1);
+
+ my %rectypes = map { $_=>1 } ( @{ $self->rectypes }, '_mstr' );
+ return 'Illegal rectype: '. $self->rectype
+ unless exists $rectypes{$self->rectype} && $rectypes{$self->rectype};
return "Illegal reczone for ". $self->rectype. ": ". $self->reczone
if $self->rectype !~ /^MX$/i && $self->reczone =~ /\*/;
@@ -291,6 +296,10 @@
$self->recdata =~ /^((\d{1,3}\.){3}\d{1,3})$/
or return "Illegal data for A record: ". $self->recdata;
$self->recdata($1);
+ } elsif ( $self->rectype eq 'AAAA' ) {
+ $self->recdata =~ /^([\da-z:]+)$/
+ or return "Illegal data for AAAA record: ". $self->recdata;
+ $self->recdata($1);
} elsif ( $self->rectype eq 'PTR' ) {
if ( $conf->exists('zone-underscore') ) {
$self->recdata =~ /^([a-z0-9_\.\-]+)$/i
@@ -312,11 +321,17 @@
$self->recdata('"'. $self->recdata. '"'); #?
}
# or return "Illegal data for TXT record: ". $self->recdata;
+ } elsif ( $self->rectype eq 'SRV' ) {
+ $self->recdata =~ /^(\d+)\s+(\d+)\s+(\d+)\s+([a-z0-9\.\-]+)$/i
+ or return "Illegal data for SRV record: ". $self->recdata;
+ $self->recdata("$1 $2 $3 $4");
} elsif ( $self->rectype eq '_mstr' ) {
$self->recdata =~ /^((\d{1,3}\.){3}\d{1,3})$/
or return "Illegal data for _master pseudo-record: ". $self->recdata;
} else {
- die "ack!";
+ warn "$me no specific check for ". $self->rectype. " records yet";
+ $error = $self->ut_text('recdata');
+ return $error if $error;
}
$self->SUPER::check;
Index: svc_domain.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_domain.pm,v
retrieving revision 1.56.2.16
retrieving revision 1.56.2.17
diff -u -w -d -r1.56.2.16 -r1.56.2.17
--- svc_domain.pm 6 Aug 2010 21:28:03 -0000 1.56.2.16
+++ svc_domain.pm 11 Sep 2010 17:02:59 -0000 1.56.2.17
@@ -303,9 +303,6 @@
The additional field I<action> should be set to I<N> for new domains, I<M>
for transfers, or I<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<email> can be used to manually set the admin contact
email address on this email. Otherwise, the svc_acct records for this package
(see L<FS::cust_pkg>) are searched. If there is exactly one svc_acct record
@@ -541,7 +538,7 @@
$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 +596,7 @@
'A' => 5,
'TXT' => 6,
'PTR' => 7,
+ 'SRV' => 8,
);
my %sort = (
More information about the freeside-commits
mailing list