[vhffs-dev] [551] Fixed a typo which caused deleted item to be kept in datastructure.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 551
Author:   beuss
Date:     2007-04-10 11:53:11 +0000 (Tue, 10 Apr 2007)

Log Message:
-----------
Fixed a typo which caused deleted item to be kept in datastructure.
Fixed a bug which prevented default domain to be created.

Modified Paths:
--------------
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/DNS.pm


Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/DNS.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/DNS.pm	2007-04-09 17:46:57 UTC (rev 550)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Services/DNS.pm	2007-04-10 11:53:11 UTC (rev 551)
@@ -299,7 +299,7 @@
     my $sql = 'DELETE FROM vhffs_dns_rr WHERE type = \'CNAME\' AND zone = ? AND name = ?';
     $dbh->do($sql, undef, $self->{dns_id}, $name) or return -2;
 
-    undef $self->{CNAME}->{$name};
+    delete $self->{CNAME}->{$name};
 
     #Update SOA
     $self->update_serial();
@@ -319,7 +319,7 @@
     my $sql = 'DELETE FROM vhffs_dns_rr WHERE type = \'NS\' AND zone = ? AND data = ?';
     $dbh->do($sql, undef, $self->{dns_id}, $host) or return -2;
 
-    undef $self->{NS}->{$host};
+    delete $self->{NS}->{$host};
 
     $self->add_history("Deleted NS record $host");
     
@@ -338,7 +338,7 @@
     my $sql = 'DELETE FROM vhffs_dns_rr WHERE type=\'MX\' AND zone= ? AND aux = ?';
     $dbh->do($sql, undef, $self->{dns_id}, $aux) or return -2;
 
-    undef $self->{MX}->{$aux};
+    delete $self->{MX}->{$aux};
 
     $self->add_history("Deleted the MX record with priority $aux");
     
@@ -358,7 +358,7 @@
     my $sql = 'DELETE FROM vhffs_dns_rr WHERE type = \'A\' AND zone = ? AND name = ?';
     $dbh->do($sql, undef, $self->{dns_id}, $name) or return -2;
 
-    undef $self->{A}->{$name};
+    delete $self->{A}->{$name};
 
     $self->add_history("Deleted A record $name");
     
@@ -432,9 +432,9 @@
     my ( $self , $name , $ip , $ttl ) = @_;
     
     $ttl = 900 if ( ! defined $ttl );
-    $name = '' if( $name eq 'default' );
     return -1 if ( $self->name_exists( $name ) != 0 );
     return -1 if( ! ($name =~ /^[a-z0-9\-]+|\*$/ ) );
+    $name = '' if( $name eq 'default' );
 
     if( ! defined $ip ) {
         my $config = $self->{'main'}->get_config;	


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/