CVS: ispman/bin ispman.addUser,1.3,1.4

Atif Ghaffar <[email protected]>
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/bin
In directory sc8-pr-cvs1:/tmp/cvs-serv27041

Modified Files:
	ispman.addUser 
Log Message:
Adding -h filehost option. Cleaning the Usage info

Index: ispman.addUser
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.addUser,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** ispman.addUser	28 Aug 2003 08:23:03 -0000	1.3
--- ispman.addUser	4 Oct 2003 02:19:05 -0000	1.4
***************
*** 3,9 ****
     use FindBin; unshift @INC, ($FindBin::Bin , "$FindBin::Bin/../lib", "$FindBin::Bin/../conf");
     use Getopt::Std;
!    getopt('dflmp',  \%opts);
     unless ($opts{'d'} && $ARGV[0]){
!       print "$0 -d domain [-f firstname] [-l lastname] [-m maildropserver] [-p password] username";
        print "\n";
        exit;
--- 3,22 ----
     use FindBin; unshift @INC, ($FindBin::Bin , "$FindBin::Bin/../lib", "$FindBin::Bin/../conf");
     use Getopt::Std;
!    getopt('dflmph',  \%opts);
     unless ($opts{'d'} && $ARGV[0]){
!       print "$FindBin::Script options username\n";
!       print "\nRequired options:\n";
!       print " -d domain\n";
!       print "\nOther options:\n";
!       print " -f firstname\n";
!       print " -l lastname\n";
!       print " -h filehost\tHost where the homeDirectory is created\n";
!       print " -m mailhost\tHost where the mailbox is created\n";
!       print " -p password\n";
!       print "\n";
!       print "if -h fileHost is not provided then the default fileserver for this domain will be used\n";
!       print "if -m maildropserver is not provided then the default maildrop server for this domain will be used\n";
!       print "If you do not want to create a mailbox for this user then use -m none\n";
!       print "if -p password is not provided then 'secret' will be used as the password\n";
        print "\n";
        exit;
***************
*** 31,35 ****
  $r->param("uid", $user);
  $r->param("userPassword", $opts{"p"});
! $r->param("mailHost", $opts{"m"});
  
  $ispman->addUser($r);
--- 44,91 ----
  $r->param("uid", $user);
  $r->param("userPassword", $opts{"p"});
! 
! 
! # If we dont want to create a mailbox for this user we
! # can specify -m none  perhaps for just mailforwardings
! unless ($opts{"m"} eq "none") {
!        if ($opts{"m"}){
!           # there should be some checking here that value of -m is actually
!           # a host defined in LDAP
!             $r->param("mailHost", $opts{"m"});
!          } elsif ($_mailhost=$ispman->getDomainAttribute($opts{'d'}, "ispmanDomainDefaultMailDropHost")){
!            # see if there is a ispmanDomainDefaultMailDropHost defined
!            # for this domain
!            $r->param("mailHost", $_mailhost);
!          } elsif ($_mailhost=$ispman->getHostGroupFirstMember('mailstoregroup')){
!            # try to get the first member from the mailstore group
!            $r->param("mailHost", $_mailhost);
!          } else {
!            # all failed. die with warning
!            print "Please either define a mailhost for this user or define\n-m none\n";
!          }
! }
! 
! # We need to know on which host to create the homeDirectory for this user.
! # We can have one or more fileservers.
! 
! unless ($opts{"h"} eq "none") {
!        if ($opts{"h"}){
!           # there should be some checking here that value of -h is actually
!           # a host defined in LDAP
!             $r->param("fileHost", $opts{"h"});
!          } elsif ($_filehost=$ispman->getDomainAttribute($opts{'d'}, "ispmanDomainDefaultFileServer")){
!            # see if there is a ispmanDomainDefaultFileServer defined
!            # for this domain
!            $r->param("fileHost", $_filehost);
!          } elsif ($_filehost=$ispman->getHostGroupFirstMember('fileservergroup')){
!            # try to get the first member from the fileservergroup
!            $r->param("fileHost", $_filehost);
!          } else {
!            # all failed. die with warning
!            print "Please either define a filehost for this user where the homedirectory should be created\n";
!          }
! }
! 
! 
  
  $ispman->addUser($r);



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