X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2Fbin%2Ffreeside-adduser;h=2f4e22cbf4eca2f219b8b507ad708727525b7505;hb=fbdaf36fb33a44a453e23bc2dc8d18637b40dae9;hp=8f9d4a33f7ff79906e40e9c33f134b35f243f605;hpb=0815da7f25324df1040ba64c84ace44e49d7387c;p=freeside.git diff --git a/FS/bin/freeside-adduser b/FS/bin/freeside-adduser index 8f9d4a33f..2f4e22cbf 100644 --- a/FS/bin/freeside-adduser +++ b/FS/bin/freeside-adduser @@ -5,36 +5,11 @@ use vars qw($opt_s $opt_g $opt_n); use Fcntl qw(:flock); use Getopt::Std; -my $FREESIDE_CONF = "/usr/local/etc/freeside"; +my $FREESIDE_CONF = "%%%FREESIDE_CONF%%%"; -getopts("s:g:n"); +getopts("g:"); my $user = shift or die &usage; - -if ( $opt_s ) { - - #if ( -e "$FREESIDE_CONF/mapsecrets" ) { - # open(MAPSECRETS,"<$FREESIDE_CONF/mapsecrets") - # or die "can't open $FREESIDE_CONF/mapsecrets: $!"; - # while () { - # /^(\S+) / or die "unparsable line in mapsecrets: $_"; - # die "user $user already exists\n" if $user eq $1; - # } - # close MAPSECRETS; - #} - - open(MAPSECRETS,">>$FREESIDE_CONF/mapsecrets") - and flock(MAPSECRETS,LOCK_EX) - or die "can't open $FREESIDE_CONF/mapsecrets: $!"; - print MAPSECRETS "$user $opt_s\n"; - close MAPSECRETS or die "can't close $FREESIDE_CONF/mapsecrets: $!"; - -} - -### - -exit if $opt_n; - -### +my $password = shift; use FS::UID qw(adminsuidsetup); use FS::CurrentUser; @@ -47,7 +22,7 @@ adminsuidsetup $user; my $access_user = new FS::access_user { 'username' => $user, - '_password' => 'notyet', + '_password' => $password, 'first' => 'Firstname', # $opt_f || 'last' => 'Lastname', # $opt_l || }; @@ -68,7 +43,7 @@ if ( $opt_g ) { ### sub usage { - die "Usage:\n\n freeside-adduser [ -n ] [ -s ] [ -g groupnum ] username [ password ]" + die "Usage:\n\n freeside-adduser [ -g groupnum ] username [ password ]" } =head1 NAME @@ -77,7 +52,7 @@ freeside-adduser - Command line interface to add (freeside) users. =head1 SYNOPSIS - freeside-adduser [ -n ] [ -s ] [ -g groupnum ] username [ password ] + freeside-adduser [ -g groupnum ] username [ password ] =head1 DESCRIPTION @@ -89,17 +64,6 @@ B. -g: initial groupnum - Development/multi-DB options: - - -s: alternate secrets file - - -n: no ACL added, for bootstrapping - -=head1 NOTE - -No explicit htpasswd options are available in 1.7 - passwordsa are now -maintained automatically. - =head1 SEE ALSO Base Freeside documentation