8 my $FREESIDE_CONF = "%%%FREESIDE_CONF%%%";
11 my $user = shift or die &usage;
14 open(HTPASSWD,"<$opt_h")
15 and flock(HTPASSWD,LOCK_EX)
16 or die "can't open $opt_h: $!";
17 open(HTPASSWD_TMP,">$opt_h.tmp") or die "can't open $opt_h.tmp: $!";
19 print HTPASSWD_TMP $_ unless /^$user:/;
22 rename "$opt_h.tmp", "$opt_h" or die $!;
23 flock(HTPASSWD,LOCK_UN);
27 open(MAPSECRETS,"<$FREESIDE_CONF/mapsecrets")
28 and flock(MAPSECRETS,LOCK_EX)
29 or die "can't open $FREESIDE_CONF/mapsecrets: $!";
30 open(MAPSECRETS_TMP,">>$FREESIDE_CONF/mapsecrets.tmp")
31 or die "can't open $FREESIDE_CONF/mapsecrets.tmp: $!";
32 while (<MAPSECRETS>) {
33 print MAPSECRETS_TMP $_ unless /^$user\s/;
36 rename "$FREESIDE_CONF/mapsecrets.tmp", "$FREESIDE_CONF/mapsecrets" or die $!;
37 flock(MAPSECRETS,LOCK_UN);
41 die "Usage:\n\n freeside-deluser [ -h htpasswd_file ] username"
46 freeside-deluser - Command line interface to add (freeside) users.
50 freeside-deluser [ -h htpasswd_file ] username
54 Adds a user to the Freeside billing system. This is for adding users (internal
55 sales/tech folks) to the web interface, not for adding customer accounts.
57 -h: Also delete from the given htpasswd filename
61 L<freeside-adduser>, L<htpasswd>(1), base Freeside documentation