[freeside-commits] freeside/FS/FS UID.pm,1.27,1.28
Ivan,,,
ivan at wavetail.420.am
Thu Jul 13 16:45:41 PDT 2006
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv32596
Modified Files:
UID.pm
Log Message:
mapsecrets file shouldn't be necessary at all...
Index: UID.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/UID.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- UID.pm 19 Jun 2006 02:33:52 -0000 1.27
+++ UID.pm 13 Jul 2006 23:45:38 -0000 1.28
@@ -267,11 +267,18 @@
$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 $user not found in mapsecrets!" unless $line;
- $line =~ /^\s*($user|\*)\s+(.*)$/;
- $secrets = $2;
- die "Illegal mapsecrets line for user?!" unless $secrets;
+
+ if ( $conf->exists('mapsecrets') ) {
+ my($line) = grep /^\s*($user|\*)\s/, $conf->config('mapsecrets');
+ die "User $user not found in mapsecrets!" unless $line;
+ $line =~ /^\s*($user|\*)\s+(.*)$/;
+ $secrets = $2;
+ die "Illegal mapsecrets line for user?!" unless $secrets;
+ } else {
+ # no mapsecrets file at all, so do the default thing
+ $secrets = 'secrets';
+ }
+
($datasrc, $db_user, $db_pass) = $conf->config($secrets)
or die "Can't get secrets: $secrets: $!\n";
$FS::Conf::default_dir = $conf_dir. "/conf.$datasrc";
More information about the freeside-commits
mailing list