ispman/lib/ISPMan ApacheMan.pm,1.45,1.46

[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-serv5406/lib/ISPMan

Modified Files:
	ApacheMan.pm 
Log Message:
added logdir, statdir to DeleteVhostDirectories process
removed ^M endings

Index: ApacheMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/ApacheMan.pm,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- ApacheMan.pm	18 Jan 2004 02:35:38 -0000	1.45
+++ ApacheMan.pm	1 Feb 2004 15:20:11 -0000	1.46
@@ -72,9 +72,9 @@
 addVhostProcess
 addVirtualHostDirectoriesProcess
 changeVhostPassword
-suggestHostForVhost
-getVhostAttribute
-setVhostAttribute 
+suggestHostForVhost
+getVhostAttribute
+setVhostAttribute 
 );
 $VERSION = '0.01';
 
@@ -269,16 +269,16 @@
    
    my $documentrootoptions=$self->as_arrayref($r->param("ispmanVhostDocumentRootOption"));
    my $scriptdiroptions=$self->as_arrayref($r->param("ispmanVhostScriptDirOption"));;
-   my $webhosts=$self->as_arrayref($r->param("webHost"));
-   if ($self->isEmpty($webhosts)){
-	   # This can happen. For example from CCP
+   my $webhosts=$self->as_arrayref($r->param("webHost"));
+   if ($self->isEmpty($webhosts)){
+	   # This can happen. For example from CCP
 		if (my $_webhost=$self->suggestHostForVhost($domain)){
-			$webhosts=$self->as_arrayref($_webhost);
-		}	   
-   } else {
-	   # Atif 2003/01/13
-	   # Should there be a check and stop here?
-   }
+			$webhosts=$self->as_arrayref($_webhost);
+		}	   
+   } else {
+	   # Atif 2003/01/13
+	   # Should there be a check and stop here?
+   }
    
 
 
@@ -342,7 +342,7 @@
    # write data to LDAP
    if (! $self->addNewEntryWithData($dn, $data)){ return 0};
 	
-   for (@$webhosts){
+   for (@$webhosts){
 	   
        # add new A-record for webhost
        # NOTICE: for multiple webhosts this will create multiple a-records which
@@ -406,7 +406,9 @@
             $ispmanVhostName, 
             $domainInfo->{'homeDirectory'}, 
             $vhostInfo->{"ispmanVhostDocumentRoot"}, 
-            $vhostInfo->{"ispmanVhostScriptDir"}, 
+            $vhostInfo->{"ispmanVhostScriptDir"},
+            $vhostInfo->{"ispmanVhostLogdir"},
+            $vhostInfo->{"ispmanVhostStatdir"}
             )
          );
 
@@ -524,42 +526,42 @@
 	my $self=shift;
 	my ($domain, $vhost, $process, $param)=@_;
 	my $vhostInfo=$self->getVhostInfo($vhost, $domain);
-	my @webHosts=$self->as_array($vhostInfo->{'webHost'});
+	my @webHosts=$self->as_array($vhostInfo->{'webHost'});
 	
-	unless (@webHosts){
-		# No webHosts defined.
-		
-		my $_webhost;
-				 
+	unless (@webHosts){
+		# No webHosts defined.
+		
+		my $_webhost;
+				 
 		if ($_webhost=$self->suggestHostForVhost($domain)){
-			push @webHosts, $_webhost;
+			push @webHosts, $_webhost;
 		} else {
 			print "No host in webserver is the group found. \nYou cannot add vhosts untill you define some hosts in the httpgroup\n";
-			return;
+			return;
 		}
-	}
+	}
 
  
-	foreach (@webHosts){
+	foreach (@webHosts){
 		$self->addProcessToHost($domain, $_, $process, $param);
 	}	
 }
-
-sub suggestHostForVhost {
-	my $self=shift;
-	
+
+sub suggestHostForVhost {
+	my $self=shift;
+	
 	my ($domain)=@_;
-
-	my $_webhost;
-			 
+
+	my $_webhost;
+			 
 	if ($_webhost=$self->getDomainAttribute($domain, "ispmanDomainDefaultWebHost")){
-		return  $_webhost;
+		return  $_webhost;
 	}elsif ($_webhost=$self->getHostGroupFirstMember('httpgroup')) {
-		return  $_webhost;
+		return  $_webhost;
 	} else {
-		return 0;
+		return 0;
 	}
-}
+}
 
 sub addVirtualHostDirectoriesProcess {
    # The admin can choose where the files for this vhost live.
@@ -593,8 +595,8 @@
 }
 
 
-
-
+
+
 sub getVhostAttribute {
 	my $self=shift;
 	my ($domain, $vhost, $attribute)=@_;	
@@ -606,15 +608,15 @@
    
    return $self->get_attr_value($entry, $attribute);
 
-}
-
+}
+
 sub setVhostAttribute {
-	my $self=shift;
-	my ($domain, $vhost, $attribute, @values)=@_;
+	my $self=shift;
+	my ($domain, $vhost, $attribute, @values)=@_;
 	my $value=$self->as_arrayref(@values);
 	my $dn=$self->getVhostDN($domain, $vhost);
 	$self->modifyAttribute($dn, $attribute, $value);
-}
+}
 
 1;
 



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