Skip to content

Commit

Permalink
introduce PROFILE_MAPPER_FILE
Browse files Browse the repository at this point in the history
  • Loading branch information
jfromaniello committed Mar 9, 2016
1 parent a3aa85b commit c16fbe6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var async = require('async');
var ldap_clients = require('./ldap');
var cb = require('cb');
var graph = require('./graph');
var _ = require('lodash');

var AccountDisabled = require('./errors/AccountDisabled');
var AccountExpired = require('./errors/AccountExpired');
Expand All @@ -14,11 +15,16 @@ var WrongPassword = require('./errors/WrongPassword');
var WrongUsername = require('./errors/WrongUsername');
var UnexpectedError = require('./errors/UnexpectedError');

var profileMapper = nconf.get('PROFILE_MAPPER') ?
eval(nconf.get('PROFILE_MAPPER')) :
require('./profileMapper');
var profileMapper;

if (nconf.get('PROFILE_MAPPER')) {
profileMapper = eval(nconf.get('PROFILE_MAPPER'));
} else if (nconf.get('PROFILE_MAPPER_FILE')) {
profileMapper = require(nconf.get('PROFILE_MAPPER_FILE'));
} else {
profileMapper = nconf.get('PROFILE_MAPPER');
}

var _ = require('lodash');

function logger(userName) {
require('colors');
Expand Down

0 comments on commit c16fbe6

Please sign in to comment.