projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
finish fixing "Real time processing not enabled!" error when using signup
[freeside.git]
/
FS
/
bin
/
freeside-adduser
diff --git
a/FS/bin/freeside-adduser
b/FS/bin/freeside-adduser
index
8f9d4a3
..
5304813
100644
(file)
--- a/
FS/bin/freeside-adduser
+++ b/
FS/bin/freeside-adduser
@@
-5,7
+5,7
@@
use vars qw($opt_s $opt_g $opt_n);
use Fcntl qw(:flock);
use Getopt::Std;
use Fcntl qw(:flock);
use Getopt::Std;
-my $FREESIDE_CONF = "
/usr/local/etc/freeside
";
+my $FREESIDE_CONF = "
%%%FREESIDE_CONF%%%
";
getopts("s:g:n");
my $user = shift or die &usage;
getopts("s:g:n");
my $user = shift or die &usage;
@@
-22,11
+22,22
@@
if ( $opt_s ) {
# close MAPSECRETS;
#}
# close MAPSECRETS;
#}
- open(MAPSECRETS,">>$FREESIDE_CONF/mapsecrets")
+ #insert new entry before a wildcard...
+ open(MAPSECRETS,"<$FREESIDE_CONF/mapsecrets")
and flock(MAPSECRETS,LOCK_EX)
or die "can't open $FREESIDE_CONF/mapsecrets: $!";
and flock(MAPSECRETS,LOCK_EX)
or die "can't open $FREESIDE_CONF/mapsecrets: $!";
- print MAPSECRETS "$user $opt_s\n";
+ open(NEW,">$FREESIDE_CONF/mapsecrets.new")
+ or die "can't open $FREESIDE_CONF/mapsecrets.new: $!";
+ while(<MAPSECRETS>) {
+ if ( /^\*\s/ ) {
+ print NEW "$user $opt_s\n";
+ }
+ print NEW $_;
+ }
close MAPSECRETS or die "can't close $FREESIDE_CONF/mapsecrets: $!";
close MAPSECRETS or die "can't close $FREESIDE_CONF/mapsecrets: $!";
+ close NEW or die "can't close $FREESIDE_CONF/mapsecrets.new: $!";
+ rename("$FREESIDE_CONF/mapsecrets.new", "$FREESIDE_CONF/mapsecrets")
+ or die "can't move mapsecrets.new into place: $!";
}
}
@@
-97,7
+108,7
@@
B<Configuration | Employees | View/Edit employees>.
=head1 NOTE
=head1 NOTE
-No explicit htpasswd options are available in 1.7 - passwords
a
are now
+No explicit htpasswd options are available in 1.7 - passwords are now
maintained automatically.
=head1 SEE ALSO
maintained automatically.
=head1 SEE ALSO