ispman/lib http.lib,1.64,1.65

Joerg Delker <[email protected]> Sun, 18 Feb 2007 13:57:47 +0000
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/lib
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16115/lib

Modified Files:
	http.lib 
Log Message:
fixed bug [ 1657912 ] vhost template should be prepared for apache 2.2


Index: http.lib
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/http.lib,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- http.lib	18 Sep 2006 20:59:12 -0000	1.64
+++ http.lib	18 Feb 2007 13:57:45 -0000	1.65
@@ -277,8 +277,10 @@
     my $vhostText     = "";
     my $vhostConfFile = $apacheVhostsFile;
     my $vhostHashFile = "$apacheVhostsFile.hash";
-    my $template      =
+    my $vhostTemplate =
       $ispman->getTemplate("$FindBin::Bin/../templates/vhosts.conf.template");
+    my $vhostAclTemplate =
+      $ispman->getTemplate("$FindBin::Bin/../templates/vhosts.acl.template");
 
     if ( $ispman->getConf("apacheVhostsStyle") =~ /dir/m ) {
 
@@ -375,16 +377,17 @@
                     $filter .= ")";
 
                     # build vhost directives
-                    $aclText .= qq|
-\t<IfModule @{[$ispman->getConf("apacheAuthLdapModule")]}.c>
-\t\t<Location @{[$vhostHash->{$domain}{$vh}{'acls'}{$_}{'ispmanVhostAclLocation'}]}>
-\t\t\tAuthType Basic
-\t\t\tAuthName $vh.$domain
-\t\t\tAuthLDAPURL ldap://@{[$ispman->getConf("ldapHost")]}/ispmanDomain=$domain,@{[$ispman->getConf('ldapBaseDN')]}?ispmanUserId?sub?$filter
-\t\t\trequire valid-user
-\t\t</Location>
-\t</IfModule>
-|;
+                    $aclText .= $vhostAclTemplate->fill_in(
+                        HASH => {
+                            location => $vhostHash->{$domain}{$vh}{'acls'}{$_}
+                              {'ispmanVhostAclLocation'},
+                            vhost      => $vh,
+                            domain     => $domain,
+                            ldapHost   => $ispman->{'Config'}{'ldapHost'},
+                            ldapBaseDN => $ispman->{'Config'}{'ldapBaseDN'},
+                            filter     => $filter
+                        }
+                    );
                 }
                 $vhostHash->{$domain}{$vh}{'acltext'} = $aclText;
             }
@@ -446,8 +449,10 @@
                 $vhostHash->{$domain}{$vh}{'ispmanVhostDocumentRootOption'} =
                   "Options None";
             }
+
+            # Fill template with data
             $vhostText .=
-              $template->fill_in( HASH => $vhostHash->{$domain}{$vh} );
+              $vhostTemplate->fill_in( HASH => $vhostHash->{$domain}{$vh} );
         }
     }
     print VHOSTS "\n$vhostText\n";


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV