[vhffs-dev] [839] Bye bye get_default_a and get_default_aaaa

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


Revision: 839
Author:   gradator
Date:     2007-08-30 20:50:59 +0000 (Thu, 30 Aug 2007)

Log Message:
-----------
Bye bye get_default_a and get_default_aaaa

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Conf.pm
    trunk/vhffs-api/src/Vhffs/Services/DNS.pm


Modified: trunk/vhffs-api/src/Vhffs/Conf.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Conf.pm	2007-08-30 18:21:30 UTC (rev 838)
+++ trunk/vhffs-api/src/Vhffs/Conf.pm	2007-08-30 20:50:59 UTC (rev 839)
@@ -139,31 +139,6 @@
 }
 
 
-sub get_default_a
-{
-	my $self = shift;
-    if( defined $Config{"services"}{"dns"}{"default_a"} )
-    {
-        return $Config{"services"}{"dns"}{"default_a"};
-    }
-    else
-    {
-        return undef;
-    }
-
-}
-
-sub get_default_aaaa
-{
-	my $self = shift;
-    if( defined $Config{services}{dns}{default_aaaa} ) {
-        return $Config{services}{dns}{default_aaaa};
-    } else {
-        return undef;
-    }
-}
-
-
 #Open the file of bad username, fill a table with them and return a reference to it
 sub get_bad_username
 {

Modified: trunk/vhffs-api/src/Vhffs/Services/DNS.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Services/DNS.pm	2007-08-30 18:21:30 UTC (rev 838)
+++ trunk/vhffs-api/src/Vhffs/Services/DNS.pm	2007-08-30 20:50:59 UTC (rev 839)
@@ -470,10 +470,10 @@
     return -2 if ( $self->name_exists( $name, 'A', 'CNAME' ) != 0 );
 
     if( ! defined $ip ) {
-        my $config = $self->{'main'}->get_config;	
-    	if( defined $config->get_default_a ) {
-    	    $ip = $config->get_default_a;
-	    } else {
+        my $dnsconfig = $self->{'main'}->get_config->get_service('dns');
+    	if( defined $dnsconfig->{'default_a'} ) {
+    	    $ip = $dnsconfig->{'default_a'};
+        } else {
     	    return -3;
     	}
     }
@@ -691,10 +691,10 @@
     return -2 if ( $self->name_exists( $name, 'CNAME', 'AAAA' ) != 0 );
 
     if( ! defined $ip ) {
-        my $config = $self->{'main'}->get_config;	
-    	if( defined $config->get_default_aaaa ) {
-    	    $ip = $config->get_default_aaaa;
-	    } else {
+        my $dnsconfig = $self->{'main'}->get_config->get_service('dns');
+    	if( defined $dnsconfig->{'default_aaaa'} ) {
+    	    $ip = $dnsconfig->{'default_aaaa'};
+        } else {
     	    return -3;
     	}
     }


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