summaryrefslogtreecommitdiff
path: root/FS/FS/svc_domain.pm
diff options
context:
space:
mode:
authorivan <ivan>2007-01-28 02:21:12 +0000
committerivan <ivan>2007-01-28 02:21:12 +0000
commit80206c4958e70b809ff1205a0d8322b5ca2d7fa8 (patch)
tree80aa263af843138878558ccafee66ee68df26c5a /FS/FS/svc_domain.pm
parent4bac99dd64706405ad85c10591bb6de319095294 (diff)
pretty up domain zone viewing a little
Diffstat (limited to 'FS/FS/svc_domain.pm')
-rw-r--r--FS/FS/svc_domain.pm21
1 files changed, 19 insertions, 2 deletions
diff --git a/FS/FS/svc_domain.pm b/FS/FS/svc_domain.pm
index 157f9e0ca..529127158 100644
--- a/FS/FS/svc_domain.pm
+++ b/FS/FS/svc_domain.pm
@@ -400,8 +400,25 @@ sub domain_record {
'PTR' => 7,
);
- sort { $order{$a->rectype} <=> $order{$b->rectype} }
- qsearch('domain_record', { svcnum => $self->svcnum } );
+ my %sort = (
+ #'SOA' => sub { $_[0]->recdata cmp $_[1]->recdata }, #sure hope not though
+# 'SOA' => sub { 0; },
+# 'NS' => sub { 0; },
+ 'MX' => sub { my( $a_weight, $a_name ) = split(/\s+/, $_[0]->recdata);
+ my( $b_weight, $b_name ) = split(/\s+/, $_[1]->recdata);
+ $a_weight <=> $b_weight or $a_name cmp $b_name;
+ },
+ 'CNAME' => sub { $_[0]->reczone cmp $_[1]->reczone },
+ 'A' => sub { $_[0]->reczone cmp $_[1]->reczone },
+
+# 'TXT' => sub { 0; },
+ 'PTR' => sub { $_[0]->reczone <=> $_[1]->reczone },
+ );
+
+ sort { $order{$a->rectype} <=> $order{$b->rectype}
+ or &{ $sort{$a->rectype} || sub { 0; } }($a, $b)
+ }
+ qsearch('domain_record', { svcnum => $self->svcnum } );
}