});
app.use(lastMile());
-var server = app.listen(3000, function () {
+var server = app.listen(process.env.LISTEN, function () {
var host = server.address().address;
var port = server.address().port;
ldapClient.bind(process.env.CLOUDRON_LDAP_BIND_DN, process.env.CLOUDRON_LDAP_BIND_PASSWORD, function (error) {
if (error) return callback(error);
- var filter = `(|(uid=${username})(mail=${username})(username=${username})(sAMAccountName=${username}))`;
- ldapClient.search(process.env.CLOUDRON_LDAP_USERS_BASE_DN, { filter: filter }, function (error, result) {
+ var filter = process.env.CLOUDRON_LDAP_FILTER.replace(/\{username\}/g, username);
+ ldapClient.search(process.env.CLOUDRON_LDAP_USERS_BASE_DN, { filter: filter, scope: "sub" }, function (error, result) {
if (error) return callback(error);
var items = [];