ispman/lib/ISPMan ApacheMan.pm,1.47,1.48

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

Modified Files:
	ApacheMan.pm 
Log Message:
fixed bug: error on vhost creation with non-dns domain


Index: ApacheMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/ApacheMan.pm,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- ApacheMan.pm	1 Feb 2004 23:37:04 -0000	1.47
+++ ApacheMan.pm	5 Feb 2004 08:43:21 -0000	1.48
@@ -341,44 +341,46 @@
 
    # write data to LDAP
    if (! $self->addNewEntryWithData($dn, $data)){ return 0};
-	
-   # add new A-record for webhost(s)
-   if ($#$webhosts==0){
-       
-       # only single webhost is defined
-       # (ispmanVhostIpAddress overrides webhost ip)
-       my $ip=(($r->param("ispmanVhostIpAddress") eq "*") ? 
-	       $self->getHostIp(@$webhosts[0]) : $r->param("ispmanVhostIpAddress"));
-       $self->addVhostDNSRecord($r->param("ispmanDomain"),
-				$r->param("ispmanVhostName"),
-				$ip);
-   } else {
 
-       # multiple webhosts are defined
-       # (apacheVhostsVIP overrides webhost ips)
-
-       if ($self->getConf("apacheVhostsVIP")=~/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/){
+   # add new A-record for webhost(s) if domain is primary
+   if ($domain_info->{'ispmanDomainType'} eq "primary"){
+       if ($#$webhosts==0){
+	   
+	   # only single webhost is defined
+	   # (ispmanVhostIpAddress overrides webhost ip)
+	   my $ip=(($r->param("ispmanVhostIpAddress") eq "*") ? 
+		   $self->getHostIp(@$webhosts[0]) : $r->param("ispmanVhostIpAddress"));
 	   $self->addVhostDNSRecord($r->param("ispmanDomain"),
 				    $r->param("ispmanVhostName"),
-				    $self->getConf("apacheVhostsVIP"));
+				    $ip);
        } else {
-
-	   # this will create multiple a-records which
-	   # will act as simple round-robin loadbalancing.
-	   # Change them manually for proper hardware loadbalancing!
-	   for (@$webhosts){
+	   
+	   # multiple webhosts are defined
+	   # (apacheVhostsVIP overrides webhost ips)
+	   
+	   if ($self->getConf("apacheVhostsVIP")=~/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/){
 	       $self->addVhostDNSRecord($r->param("ispmanDomain"),
 					$r->param("ispmanVhostName"),
-					$self->getHostIp($_));
+					$self->getConf("apacheVhostsVIP"));
+	   } else {
+	       
+	       # this will create multiple a-records which
+	       # will act as simple round-robin loadbalancing.
+	       # Change them manually for proper hardware loadbalancing!
+	       for (@$webhosts){
+		   $self->addVhostDNSRecord($r->param("ispmanDomain"),
+					    $r->param("ispmanVhostName"),
+					    $self->getHostIp($_));
+	       }
+	   }
+	   
+	   # add process for each webhost
+	   for (@$webhosts){
+	       $self->addProcessToHost($r->param("ispmanDomain"),
+				       $_,
+				       "AddVirtualHost",
+				       $r->param("ispmanVhostName"));
 	   }
-       }
-
-       # add process for each webhost
-       for (@$webhosts){
-	   $self->addProcessToHost($r->param("ispmanDomain"),
-				   $_,
-				   "AddVirtualHost",
-				   $r->param("ispmanVhostName"));
        }
    }
 



-------------------------------------------------------
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.