ispman/lib/ISPMan ApacheMan.pm,1.54,1.55 DomainMan.pm,1.58,1.59 UserMan.pm,1.43,1.44

Joerg Delker <[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-serv22430/lib/ISPMan

Modified Files:
	ApacheMan.pm DomainMan.pm UserMan.pm 
Log Message:
renamed suggestHostFor... functions to getDefault...Host and moved them to DomainMan.pm, since they are domain related funtions

Index: ApacheMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/ApacheMan.pm,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- ApacheMan.pm	17 Apr 2004 07:51:53 -0000	1.54
+++ ApacheMan.pm	17 Apr 2004 15:43:35 -0000	1.55
@@ -72,7 +72,6 @@
 addVhostProcess
 addVirtualHostDirectoriesProcess
 changeVhostPassword
-suggestHostForVhost
 getVhostAttribute
 setVhostAttribute 
 );
@@ -286,14 +285,13 @@
    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
-		if (my $_webhost=$self->suggestHostForVhost($domain)){
-			$webhosts=$self->as_arrayref($_webhost);
-		}	   
-   } else {
-	   # Atif 2003/01/13
-	   # Should there be a check and stop here?
-           # jdelker: check? stop? why? webhosts has content in this branch.
+       # This can happen. For example from CCP
+       $webhosts=$self->getDefaultWebHost($domain);
+   }
+
+   unless ($webhosts){
+       print "The webhost for $ispmanVhostName cannot be determined!<br>Please check DefaultFileHost for domain $domain!\n";
+       return;
    }
    
 
@@ -577,7 +575,7 @@
 		
 		my $_webhost;
 				 
-		if ($_webhost=$self->suggestHostForVhost($domain)){
+		if ($_webhost=$self->getDefaultWebHost($domain)){
 			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";
@@ -591,21 +589,6 @@
 	}	
 }
 
-sub suggestHostForVhost {
-	my $self=shift;
-	
-	my ($domain)=@_;
-
-	my $_webhost;
-			 
-	if ($_webhost=$self->getDomainAttribute($domain, "ispmanDomainDefaultWebHost")){
-		return  $_webhost;
-	}elsif ($_webhost=$self->getHostGroupFirstMember('httpgroup')) {
-		return  $_webhost;
-	} else {
-		return 0;
-	}
-}
 
 sub addVirtualHostDirectoriesProcess {
    # The admin can choose where the files for this vhost live.

Index: UserMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/UserMan.pm,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- UserMan.pm	17 Apr 2004 15:13:00 -0000	1.43
+++ UserMan.pm	17 Apr 2004 15:43:36 -0000	1.44
@@ -42,21 +42,17 @@
    addMailForwardForUser
    replaceMailForwardForUser
    
-   
    set_user_attributes
-getUserAttributeValues
-addUserAttributeValues
-replaceUserAttributeValues
-
-
+   getUserAttributeValues
+   addUserAttributeValues
+   replaceUserAttributeValues
 
    changePassword
    searchUsers
 
    addUserFileServerProcess
-suggestHostForFileServer
-
 );
+
 $VERSION = '0.01';
 
 
@@ -118,7 +114,7 @@
    my $self=shift;
    my $r=shift;
 
-   # filter supplied uid 
+   # filter supplied uid
    my $userid=$r->param("uid");
    $userid=lc($userid);
    $userid=~s/[^a-z0-9\-_\.]//g;
@@ -172,7 +168,7 @@
    }
 
    unless (defined $r->param("fileHost") && $r->param("fileHost") ne "none" ){
-		   $r->param('fileHost', $self->suggestHostForFileServer($domain));
+		   $r->param('fileHost', $self->getDefaultFileHost($domain));
    }
    
 
@@ -573,54 +569,6 @@
      }
 }
 
-
-
-
-
-
-
-
-
-sub suggestHostForFileServer {
-	my $self=shift;
-	
-	my ($domain)=@_;
-
-	my $_filehost;
-			 
-	if ($_filehost=$self->getDomainAttribute($domain, "ispmanDomainDefaultFileServer")){
-		return  @$_filehost[0];
-	}elsif ($_filehost=$self->getHostGroupFirstMember('fileservergroup')) {
-		return  $_filehost;
-	} else {
-		return 0;
-	}
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 1;
 
 __END__

Index: DomainMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/DomainMan.pm,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- DomainMan.pm	18 Feb 2004 21:43:24 -0000	1.58
+++ DomainMan.pm	17 Apr 2004 15:43:36 -0000	1.59
@@ -102,6 +102,9 @@
 addDomainSMTPProcess
 addDomainDNSProcess
 changeDomainPassword
+getDefaultFileHost
+getDefaultMailHost
+getDefaultWebHost
 );
 
 $VERSION = '0.01';
@@ -1529,6 +1532,7 @@
    $self->updateEntryWithData($dn, {'FTPStatus' => 'enabled', 'ispmanStatus' => "active"});
    return;
 }
+
                                    
 sub changeDomainPassword {
    my $self=shift;
@@ -1542,6 +1546,57 @@
 }
 
 
+sub getDefaultFileHost {
+    my $self=shift;
+    
+    my ($domain)=@_;
+    
+    my $_host;
+    
+    if ($_host=$self->getDomainAttribute($domain, "ispmanDomainDefaultFileServer")){
+	return  @$_host[0];
+    } elsif ($_host=$self->getHostGroupFirstMember('fileservergroup')) {
+	return  $_host;
+    } else {
+	return 0;
+    }
+}
+
+
+sub getDefaultMailHost {
+    my $self=shift;
+    
+    my ($domain)=@_;
+    
+    my $_host;
+    
+    if ($_host=$self->getDomainAttribute($domain, "ispmanDomainDefaultMailDropHost")){
+	return  @$_host[0];
+    } elsif ($_host=$self->getHostGroupFirstMember('mailstoregroup')) {
+	return  $_host;
+    } else {
+	return 0;
+    }
+}
+
+
+sub getDefaultWebHost {
+	my $self=shift;
+	
+	my ($domain)=@_;
+
+	my $_host;
+			 
+	if ($_host=$self->getDomainAttribute($domain, "ispmanDomainDefaultWebHost")){
+		return  $_host;
+	}elsif ($_host=$self->getHostGroupFirstMember('httpgroup')) {
+		return  $self->as_arrayref($_host);
+	} else {
+		return 0;
+	}
+}
+
+
 1;
 __END__
 



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
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.