4 use vars qw($opt_s $opt_g $opt_n);
8 my $FREESIDE_CONF = "/usr/local/etc/freeside";
11 my $user = shift or die &usage;
15 #if ( -e "$FREESIDE_CONF/mapsecrets" ) {
16 # open(MAPSECRETS,"<$FREESIDE_CONF/mapsecrets")
17 # or die "can't open $FREESIDE_CONF/mapsecrets: $!";
18 # while (<MAPSECRETS>) {
19 # /^(\S+) / or die "unparsable line in mapsecrets: $_";
20 # die "user $user already exists\n" if $user eq $1;
25 open(MAPSECRETS,">>$FREESIDE_CONF/mapsecrets")
26 and flock(MAPSECRETS,LOCK_EX)
27 or die "can't open $FREESIDE_CONF/mapsecrets: $!";
28 print MAPSECRETS "$user $opt_s\n";
29 close MAPSECRETS or die "can't close $FREESIDE_CONF/mapsecrets: $!";
39 use FS::UID qw(adminsuidsetup);
42 use FS::access_usergroup;
44 $FS::CurrentUser::upgrade_hack = 1;
45 #adminsuidsetup $rootuser;
48 my $access_user = new FS::access_user {
50 '_password' => 'notyet',
51 'first' => 'Firstname', # $opt_f ||
52 'last' => 'Lastname', # $opt_l ||
54 my $au_error = $access_user->insert;
55 die $au_error if $au_error;
59 my $access_usergroup = new FS::access_usergroup {
60 'usernum' => $access_user->usernum,
63 my $aug_error = $access_usergroup->insert;
64 die $aug_error if $aug_error;
71 die "Usage:\n\n freeside-adduser [ -n ] [ -s ] [ -g groupnum ] username [ password ]"
76 freeside-adduser - Command line interface to add (freeside) users.
80 freeside-adduser [ -n ] [ -s ] [ -g groupnum ] username [ password ]
84 Adds a user to the Freeside billing system. This is for adding users (internal
85 sales/tech folks) to the web interface, not for adding customer accounts.
87 This functionality is now available in the web interface as well, under
88 B<Configuration | Employees | View/Edit employees>.
92 Development/multi-DB options:
94 -s: alternate secrets file
96 -n: no ACL added, for bootstrapping
100 No explicit htpasswd options are available in 1.7 - passwordsa are now
101 maintained automatically.
105 Base Freeside documentation