diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/InitHandler.pm | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/FS/FS/InitHandler.pm b/FS/FS/InitHandler.pm index 9a2154aa1..73697300e 100644 --- a/FS/FS/InitHandler.pm +++ b/FS/FS/InitHandler.pm @@ -1,9 +1,12 @@ package FS::InitHandler; use strict; +use vars qw($DEBUG); use FS::UID qw(adminsuidsetup); use FS::Record; +$DEBUG = 1; + sub handler { =pod @@ -59,12 +62,18 @@ sub handler { =cut + warn "[FS::InitHandler] handler called\n" if $DEBUG; + open(MAPSECRETS,"<$FS::UID::conf_dir/mapsecrets") or die "can't read $FS::UID::conf_dir/mapsecrets: $!"; + my %seen; while (<MAPSECRETS>) { - /^([\w\-\.]+)\s/ or do { warn "strange line in mapsecrets: $_"; next; }; - my $user = $1; + /^([\w\-\.]+)\s(.*)$/ + or do { warn "strange line in mapsecrets: $_"; next; }; + my($user, $datasrc) = ($1, $2); + next if $seen{$datasrc}++; + warn "[FS::InitHandler] preloading $datasrc for $user\n" if $DEBUG; adminsuidsetup($user); } |