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

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-serv14656/lib/ISPMan

Modified Files:
	UserMan.pm 
Log Message:
moved some logic from UserMan.pm to user.ldif.template to allow better customizing

Index: UserMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/UserMan.pm,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- UserMan.pm	17 Apr 2004 16:18:44 -0000	1.45
+++ UserMan.pm	18 Apr 2004 19:19:32 -0000	1.46
@@ -127,35 +127,36 @@
    
    my $domain=$r->param("ispmanDomain");
 
+   
+   # check user limit for this domain
    my $domainMaxUsers = $self->getDomainAttribute($domain,"ispmanMaxAccounts");
    my $domainUserCount = $self->getUserCount($domain);
-   
    if ($domainMaxUsers>0 && $domainUserCount >= $domainMaxUsers) {
    	  $self->{'message'}="Max accounts limit exceeded. <br>Your limit is $domainMaxUsers <br>You cannot create any more users.";
    	  print $self->{'message'};
    	  return;
    }
    
-
    # build unique uid from userid and domain
    my $_uid=$self->create_uid($r->param("userid"), $r->param("ispmanDomain"));
    $r->param("uid", $_uid);
    
+   # build new DN for user
    my $dn="uid=$_uid, ou=users, ispmanDomain=$domain, " . $self->{'Config'}{'ldapBaseDN'};
-   
    $r->param("dn", $dn);
 
    $self->prepareBranchForDN("ou=users, ispmanDomain=$domain, @{[$self->getConf('ldapBaseDN')]}");
-   #$r->param("nsroaming", "N");
-                    
-   #print $r->as_string;
-
+   
+   # get domain info and supply it to session data so we can use it in user ldif template
    my $domain_info=$self->getDomainInfo($r->param("ispmanDomain"));
-   my $homeDirectory=join '/', ($domain_info->{'homeDirectory'}, "users", $r->param("uid"), "");
-   my $cn=($r->param("givenName") && $r->param("sn"))? join " ", ($r->param("givenName"), $r->param("sn")) :$r->param("userid");
-   $r->param("cn", $cn);
-   $r->param("sn", ($r->param("sn")? $r->param("sn"):$r->param("userid")));
-   $r->param("homeDirectory", $homeDirectory);
+   $r->param("domaininfo", $domain_info);
+   
+   # moved to user template
+   #my $homeDirectory=join '/', ($domain_info->{'homeDirectory'}, "users", $r->param("uid"), "");
+   #my $cn=($r->param("givenName") && $r->param("sn"))? join " ", ($r->param("givenName"), $r->param("sn")) :$r->param("userid");
+   #$r->param("cn", $cn);
+   #$r->param("sn", ($r->param("sn")? $r->param("sn"):$r->param("userid")));
+   #$r->param("homeDirectory", $homeDirectory);
 
    # validate ftp quota 
    if ($r->param("FTPQuotaMBytes") !~ /\d\d*/  || $r->param("FTPQuotaMBytes") < 0) {
@@ -170,20 +171,14 @@
    unless (defined $r->param("fileHost") && $r->param("fileHost") ne "none" ){
 		   $r->param('fileHost', $self->getDefaultFileHost($domain));
    }
-   
-
-   $r->param("homeDirectory", $homeDirectory);
-
 
+   # add user to LDAP from user ldif template
    if ($self->addDataFromLdif("templates/users.ldif.template", $r)){
       if  ($r->param("mailHost")) {
          $self->addProcessToHost($domain,    $r->param("mailHost"), "createMailbox", join "", ($self->getConf("imapMailboxPrefix"), $_uid));
          $self->addProcessToHost($domain,    $r->param("mailHost"), "setMailboxQuota", join ',', ((join "", ($self->getConf("imapMailboxPrefix"), $_uid)), $r->param("mailQuota")*1024));
       }
-      # Old method, send the homedirectory creation process to the fileserver group
-      # $self->addProcessToGroup($domain,    "fileservergroup", "createHomeDirectory", $_uid);
-
-      # %%% new method %%
+      
       # send the process to method addUserFileServerProcess
       # the process will only be sent to fileHost if one is defined
       # if not defined then we fall back to the old method and send to the filserver group



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