CVS: ispman/lib/ISPMan UserMan.pm,1.32,1.33

Atif Ghaffar <[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-serv12538

Modified Files:
	UserMan.pm 
Log Message:
Return without doing anything if filehost passed is 'undefined'

Index: UserMan.pm
===================================================================
RCS file: /cvsroot/ispman/ispman/lib/ISPMan/UserMan.pm,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** UserMan.pm	20 May 2003 19:22:54 -0000	1.32
--- UserMan.pm	4 Oct 2003 03:31:14 -0000	1.33
***************
*** 116,120 ****
     my $self=shift;
     my $r=shift;
!    
     
     my $userid=$r->param("uid");
--- 116,120 ----
     my $self=shift;
     my $r=shift;
! 
     
     my $userid=$r->param("uid");
***************
*** 147,156 ****
     $r->param("cn", $cn);
     $r->param("homeDirectory", $homeDirectory);
!    
     #define 1 MB quota by default
     if ($r->param("FTPQuotaMBytes") !~ /\d\d*/  || $r->param("FTPQuotaMBytes") < 0) {
        $r->param("FTPQuotaMBytes", 1);
     }
!    
     #define 5 MB quota by default
     if ($r->param("mailQuota") !~ /\d\d*/  || $r->param("mailQuota") < 0) {
--- 147,156 ----
     $r->param("cn", $cn);
     $r->param("homeDirectory", $homeDirectory);
! 
     #define 1 MB quota by default
     if ($r->param("FTPQuotaMBytes") !~ /\d\d*/  || $r->param("FTPQuotaMBytes") < 0) {
        $r->param("FTPQuotaMBytes", 1);
     }
! 
     #define 5 MB quota by default
     if ($r->param("mailQuota") !~ /\d\d*/  || $r->param("mailQuota") < 0) {
***************
*** 160,171 ****
     $r->param("homeDirectory", $homeDirectory);
  
!    
     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 %%
--- 160,171 ----
     $r->param("homeDirectory", $homeDirectory);
  
! 
     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 %%
***************
*** 173,177 ****
        # 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
!       
        # passing domain, username, process and username as params
        $self->addUserFileServerProcess($domain, $_uid, 'createHomeDirectory', $_uid);
--- 173,177 ----
        # 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
! 
        # passing domain, username, process and username as params
        $self->addUserFileServerProcess($domain, $_uid, 'createHomeDirectory', $_uid);
***************
*** 215,227 ****
     my $self=shift;
     my $dn=shift;
!    
!    #bare function to remove user, 
     #can be called from CLI or other subroutines
     # get all values from the dn to the hash
!    
     $self->{'user'}=$self->{'ldap'}->getEntryAsHashRef($dn);
  
     #it is possible that as user has multiple uids.
!    #hint 
     #aghaffar_ispman_org
     #[email protected]
--- 215,227 ----
     my $self=shift;
     my $dn=shift;
! 
!    #bare function to remove user,
     #can be called from CLI or other subroutines
     # get all values from the dn to the hash
! 
     $self->{'user'}=$self->{'ldap'}->getEntryAsHashRef($dn);
  
     #it is possible that as user has multiple uids.
!    #hint
     #aghaffar_ispman_org
     #[email protected]
***************
*** 231,235 ****
  
     # first send processes.
!    
     # %%% new method %%
     # send the process to method addUserFileServerProcess
--- 231,235 ----
  
     # first send processes.
! 
     # %%% new method %%
     # send the process to method addUserFileServerProcess
***************
*** 239,243 ****
     # passing domain, username, process and username,homedirecory,uid,gid  as params
  
!    $self->addUserFileServerProcess($self->{'user'}{'ispmanDomain'}, $self->{'user'}{'uid'}, 'deleteHomeDirectory', 
     join ',', ($self->{'user'}{'uid'}, $self->{'user'}{'homeDirectory'}, $self->{'user'}{'uidNumber'},$self->{'user'}{'gidNumber'}));
     if ($self->{'user'}{"mailHost"}=~/\S/) {
--- 239,243 ----
     # passing domain, username, process and username,homedirecory,uid,gid  as params
  
!    $self->addUserFileServerProcess($self->{'user'}{'ispmanDomain'}, $self->{'user'}{'uid'}, 'deleteHomeDirectory',
     join ',', ($self->{'user'}{'uid'}, $self->{'user'}{'homeDirectory'}, $self->{'user'}{'uidNumber'},$self->{'user'}{'gidNumber'}));
     if ($self->{'user'}{"mailHost"}=~/\S/) {
***************
*** 254,258 ****
     my $self=shift;
     my $r=shift;
!    
     my $uid=$r->param("uid");
     my $domain=$r->param("ispmanDomain");
--- 254,258 ----
     my $self=shift;
     my $r=shift;
! 
     my $uid=$r->param("uid");
     my $domain=$r->param("ispmanDomain");
***************
*** 532,535 ****
--- 532,536 ----
       my $userInfo=$self->getUserInfo($uid);
       if ($userInfo->{'fileHost'}){
+              return if $userInfo->{'fileHost'} eq "undefined";
               $self->addProcessToHost($domain, $userInfo->{'fileHost'} , $process, $param);
       } else {



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