first part of ACL and re-skinning work and some other small stuff
[freeside.git] / FS / FS / svc_domain.pm
index b713e3e..bdaf79b 100644 (file)
@@ -230,7 +230,11 @@ sub delete {
     my $error = $domain_record->delete;
     if ( $error ) {
       $dbh->rollback if $oldAutoCommit;
-      return $error;
+      return "can't delete DNS entry: ".
+             join(' ', map $domain_record->$_(),
+                           qw( reczone recaf rectype recdata )
+                 ).
+             ":$error";
     }
   }
 
@@ -342,7 +346,8 @@ sub check {
            " (or unknown registry - try \$whois_hack)";
   }
 
-  $recref->{action} =~ /^(M|N)$/ or return "Illegal action";
+  $recref->{action} =~ /^(M|N)$/
+    or return "Illegal action: ". $recref->{action};
   $recref->{action} = $1;
 
   if ( $recref->{catchall} ne '' ) {
@@ -363,11 +368,13 @@ sub domain_record {
   my $self = shift;
 
   my %order = (
-    SOA => 1,
-    NS => 2,
-    MX => 3,
-    CNAME => 4,
-    A => 5,
+    'SOA'   => 1,
+    'NS'    => 2,
+    'MX'    => 3,
+    'CNAME' => 4,
+    'A'     => 5,
+    'TXT'   => 6,
+    'PTR'   => 7,
   );
 
   sort { $order{$a->rectype} <=> $order{$b->rectype} }