CVS: ispman/lib http.lib,1.42,1.43

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

Modified Files:
	http.lib 
Log Message:
modifications to make upto date with 1.0

Index: http.lib
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/http.lib,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -r1.42 -r1.43
*** http.lib	8 Oct 2003 01:24:40 -0000	1.42
--- http.lib	8 Oct 2003 02:27:33 -0000	1.43
***************
*** 10,13 ****
--- 10,24 ----
  
  
+ if ($ispman->getConf("apacheVhostsStyle") =~ /dir/m) {
+    unless ( -d "$vhostConfFile" && -d "$vhostConfFile/hash" &&  -d "$vhostConfFile/conf") {
+           print "Apache file dirs did not exist. Creating now.\n";
+           print "mkdir -p $vhostConfFile/conf\n";
+           system "mkdir -p $vhostConfFile/conf\n";
+           print "mkdir -p $vhostConfFile/hash\n";
+           system "mkdir -p $vhostConfFile/hash\n";
+     }
+ }
+ 
+ 
  sub read_vhosts_hash{
  	my $vhostsFile=shift;
***************
*** 50,72 ****
    my $vhostConfFile = $apacheVhostsFile;
    my $vhostHashFile = "$apacheVhostsFile.hash";
-  
-   if ($ispman->getConf("apacheVhostsStyle") =~ /dir/m) {
-     unless ( -d "$vhostConfFile" && -d "$vhostConfFile/hash" && 
-              -d "$vhostConfFile/conf") {
-       print "Apache file dirs did not exist. Creating now.\n";
-       print "mkdir -p $vhostConfFile/conf\n";
-       system "mkdir -p $vhostConfFile/conf\n";
-       print "mkdir -p $vhostConfFile/hash\n";
-       system "mkdir -p $vhostConfFile/hash\n";
-     }
  
      $vhostHashFile = "$vhostConfFile/hash/$domain.hash";
      $vhostConfFile .= "/conf/$domain.conf";
    }   
  
    $domain_replicas = $ispman->getReplicasOfDomain($domain);
     
    print "Working on $vhost.$domain\n\n";
!    
    my @_serverAliases=$vhostInfo->{'ispmanVhostServerAlias'};
    if ($domain_replicas) {
--- 61,77 ----
    my $vhostConfFile = $apacheVhostsFile;
    my $vhostHashFile = "$apacheVhostsFile.hash";
  
+   if ($ispman->getConf("apacheVhostsStyle") =~ /dir/m) {
      $vhostHashFile = "$vhostConfFile/hash/$domain.hash";
      $vhostConfFile .= "/conf/$domain.conf";
    }   
  
+   # this is useful if there is no homedirectory defined
+   # can happen when moving from version <=0.5
+   $domainInfo->{'homedirectory'}||=join "/", ($ispman->getConf("defaultHomeDirectoryPath"), $domain);
    $domain_replicas = $ispman->getReplicasOfDomain($domain);
     
    print "Working on $vhost.$domain\n\n";
! 
    my @_serverAliases=$vhostInfo->{'ispmanVhostServerAlias'};
    if ($domain_replicas) {
***************
*** 90,93 ****
--- 95,99 ----
          push(@_serverAliases, $_serverAlias);
          $_thisAlias = $_serverAlias;
+                 print "thisAlias before subs: $_thisAlias  /$domain/$_replica/ \n";
          $_thisAlias =~ s!$domain!$_replica!gei;
          push(@_serverAliases, $_thisAlias);
***************
*** 138,142 ****
      urlredirect                    => $ispman->getRedirections($domain,$vhost),
    };
!    
     
    if ($vhostInfo->{'ispmanVhostDocumentRoot'} !~ /^\//) {
--- 144,148 ----
      urlredirect                    => $ispman->getRedirections($domain,$vhost),
    };
! 
     
    if ($vhostInfo->{'ispmanVhostDocumentRoot'} !~ /^\//) {
***************
*** 193,205 ****
  
    if ($ispman->getConf("apacheVhostsStyle") =~ /dir/m) {
-     unless ( -d "$vhostConfFile" && -d "$vhostConfFile/hash" &&
-              -d "$vhostConfFile/conf") {
-       print "Apache file dirs did not exist. Creating now.\n";
-       print "mkdir -p $vhostConfFile/conf\n";
-       system "mkdir -p $vhostConfFile/conf\n";
-       print "mkdir -p $vhostConfFile/hash\n";
-       system "mkdir -p $vhostConfFile/hash\n";
-     }
- 
      $vhostHashFile = "$vhostConfFile/hash/$domain.hash";
      $vhostConfFile .= "/conf/$domain.conf";
--- 199,202 ----
***************
*** 211,216 ****
    write_vhosts_hash("$vhostHashFile", $vhostHash);
  
!   unlink("$vhostConfFile") if ( -x "$vhostConfFile");
!   unlink("$vhostHashFile") if ( -x "$vhostHashFile");
      
    return 1;
--- 208,215 ----
    write_vhosts_hash("$vhostHashFile", $vhostHash);
  
!   ## Not sure about what they do. 
!   ## TheSin, please contact me about this.
!   # unlink("$vhostConfFile") if ( -x "$vhostConfFile");
!   # unlink("$vhostHashFile") if ( -x "$vhostHashFile");
      
    return 1;
***************
*** 225,236 ****
  
    if ($ispman->getConf("apacheVhostsStyle") =~ /dir/m) {
-     unless ( -d "$vhostConfFile" && -d "$vhostConfFile/hash" &&
-              -d "$vhostConfFile/conf") {
-       print "Apache file dirs did not exist. Creating now.\n";
-       print "mkdir -p $vhostConfFile/conf\n";
-       system "mkdir -p $vhostConfFile/conf\n";
-       print "mkdir -p $vhostConfFile/hash\n";
-       system "mkdir -p $vhostConfFile/hash\n";
-     }
  
      $vhostHashFile = "$vhostConfFile/hash/$domain.hash";
--- 224,227 ----
***************
*** 241,245 ****
  
    my $name;
!   do { 
      $name = tmpnam()
    } until sysopen(VHOSTS, $name, O_RDWR|O_CREAT|O_EXCL);
--- 232,236 ----
  
    my $name;
!   do {
      $name = tmpnam()
    } until sysopen(VHOSTS, $name, O_RDWR|O_CREAT|O_EXCL);



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
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.