-sub getsecrets {
- my($setuser) = shift;
- $user = $setuser if $setuser;
- die "No user!" unless $user;
- my($conf) = new FS::Conf $conf_dir;
- my($line) = grep /^\s*$user\s/, $conf->config('mapsecrets');
- die "User not found in mapsecrets!" unless $line;
- $line =~ /^\s*$user\s+(.*)$/;
- $secrets = $1;
- die "Illegal mapsecrets line for user?!" unless $secrets;
- ($datasrc, $db_user, $db_pass) = $conf->config($secrets)
- or die "Can't get secrets: $!";
- $FS::Conf::default_dir = $conf_dir. "/conf.$datasrc";
- undef $driver_name;
- ($datasrc, $db_user, $db_pass);