ispman/bin ispman.ldap2apache,1.11,1.12

Joerg Delker <[email protected]> Sun, 11 Feb 2007 13:02:51 +0000
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/bin
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv20301/bin

Modified Files:
	ispman.ldap2apache 
Log Message:
fixed bug [ 1630766 ] ispman.ldap2apache works only on $hostname, not on aliases

Index: ispman.ldap2apache
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.ldap2apache,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ispman.ldap2apache	18 Sep 2006 21:03:08 -0000	1.11
+++ ispman.ldap2apache	11 Feb 2007 13:02:46 -0000	1.12
@@ -47,8 +47,14 @@
 unless ( $opts{'a'} ) {
     require Sys::Hostname;
     import Sys::Hostname;
-    $filter =
-      sprintf( "&(objectclass=ispmanVirtualHost)(webHost=%s)", hostname() );
+    my $hostname = hostname();
+    # get all host aliases
+    my $hostInfo = $ispman->getHostInfo($hostname);
+    if ( defined($hostInfo) ) {
+       @hostnames = $ispman->as_array( $hostInfo->{'ispmanHostAlias'} );
+    }
+    push @hostnames, $hostname;
+    $filter = "(&(objectclass=ispmanVirtualHost)(|".join("", map { "(webHost=$_)" } @hostnames)."))";
 }
 
 print "Using $filter\n" if $ispman->{'Config'}{'debug'};


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642