ispman/lib/ISPMan UserMan.pm,1.34,1.35

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

Modified Files:
	UserMan.pm 
Log Message:
adding suggestHostForFileServer

This can be used when creating a user and no fileserver is passed with the args


Index: UserMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/UserMan.pm,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- UserMan.pm	9 Jan 2004 22:04:17 -0000	1.34
+++ UserMan.pm	14 Jan 2004 02:05:13 -0000	1.35
@@ -54,6 +54,8 @@
    searchUsers
 
    addUserFileServerProcess
+suggestHostForFileServer
+
 );
 $VERSION = '0.01';
 
@@ -155,7 +157,12 @@
    #define 5 MB quota by default
    if ($r->param("mailQuota") !~ /\d\d*/  || $r->param("mailQuota") < 0) {
       $r->param("mailQuota", 5);
-   }
+   }
+   
+   unless (defined $r->param("fileHost") && $r->param("fileHost") ne "none" ){
+		   $r->param('fileHost', $self->suggestHostForFileServer($domain));
+   }
+   
 
    $r->param("homeDirectory", $homeDirectory);
 
@@ -546,10 +553,21 @@
 
 
 
-
-
-
-
+sub suggestHostForFileServer {
+	my $self=shift;
+	
+	my ($domain)=@_;
+
+	my $_filehost;
+			 
+	if ($_filehost=$self->getDomainAttribute($domain, "ispmanDomainDefaultFileServer")){
+		return  $_filehost;
+	}elsif ($_filehost=$self->getHostGroupFirstMember('fileservergroup')) {
+		return  $_filehost;
+	} else {
+		return 0;
+	}
+}
 
 
 




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
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.