ispman/lib/ISPMan ApacheMan.pm,1.42,1.43 DNSMan.pm,1.28,1.29

[email protected]
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/lib/ISPMan
In directory sc8-pr-cvs1:/tmp/cvs-serv9581

Modified Files:
	ApacheMan.pm DNSMan.pm 
Log Message:
fixed bug (DNS A-record creation for vhost with multiple webservers)


Index: ApacheMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/ApacheMan.pm,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- ApacheMan.pm	14 Jan 2004 01:03:39 -0000	1.42
+++ ApacheMan.pm	17 Jan 2004 17:05:27 -0000	1.43
@@ -411,7 +411,9 @@
       $self->addVhostProcess($ispmanDomain, $ispmanVhostName, "DeleteVirtualHost", $ispmanVhostName);
       # Delete the A Record from DNS for this vhost
       # It will only be deleted if it was added bythis vhost process
-      $self->deleteVhostDNSRecord($ispmanDomain, $ispmanVhostName);
+      if ($self->deleteVhostDNSRecord($ispmanDomain, $ispmanVhostName)>=0) {
+	  $self->modifyDnsProcess($ispmanDomain);
+      }
       
 
       if ($self->delTree($dn)) {

Index: DNSMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/DNSMan.pm,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- DNSMan.pm	13 Sep 2003 04:12:27 -0000	1.28
+++ DNSMan.pm	17 Jan 2004 17:05:27 -0000	1.29
@@ -218,8 +218,9 @@
    # This tells us that the record was created when creating a vhost
    # It should be deleted when deleting the vhost
    my ($domain, $vhost, $ip)=@_;
-   my $branch=$self->getDNSDN($domain);
-   if (! $self->isArecord($vhost, $domain)) {
+   my $branch=join ",", ("ou=aRecord", $self->getDNSDN($domain));
+   my $entry=$self->getEntry($branch, "relativeDomainname=$vhost", [], "sub");
+   if (! defined $entry or $entry->get_value('tXTRecord')=~m/ispmanVirtualHost/) {
       $self->newDNSRecord($domain, "aRecord", $vhost, $ip, {'tXTRecord' => "ispmanVirtualHost:$vhost.$domain"} );
    }
 }
@@ -236,11 +237,12 @@
    #print "Searching on $branch\n";
    #print "Looking for ispmanVirtualHost:$vhost.$domain\n";
 
-   my $entry=$self->getEntry($branch, "txtRecord=ispmanVirtualHost:$vhost.$domain", [], 'sub');
-   return unless $entry;
-   if (defined $entry->dn){
-      $self->deleteEntry($entry->dn);
+   my @entries=$self->getEntries($branch, "txtRecord=ispmanVirtualHost:$vhost.$domain", [], 'sub');
+   for (@entries) {
+	$self->deleteEntry($_->dn);
    }
+
+   return $#entries;
 }
 
 




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.