From 14782a56b73aea3549d171200e1e2bd44abc12ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Wed, 10 Aug 2016 02:14:09 -0400 Subject: [PATCH] Use our logger instead of console.{log,error} --- src/server.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server.js b/src/server.js index 3199966d..5c1d63f3 100644 --- a/src/server.js +++ b/src/server.js @@ -28,7 +28,7 @@ module.exports = function() { var server = null; if (config.public && (config.ldap || {}).enable) { - throw "Server is public and set to use LDAP. Please disable public if trying to use LDAP authentication."; + log.warn("Server is public and set to use LDAP. Set to private mode if trying to use LDAP authentication."); } if (!config.https.enable) { @@ -50,7 +50,7 @@ module.exports = function() { require("./identd").start(config.identd.port); } - if ((config.ldap || {}).enable) { + if (!config.public && (config.ldap || {}).enable) { ldapclient = ldap.createClient({ url: config.ldap.url }); @@ -243,7 +243,7 @@ function localAuth(client, user, password, callback) { result = bcrypt.compareSync(password || "", client.config.password); } catch (error) { if (error === "Not a valid BCrypt hash.") { - console.error("User (" + user + ") with no local password set tried signed in. (Probably a ldap user)"); + log.error("User (" + user + ") with no local password set tried to sign in. (Probably a LDAP user)"); } result = false; } finally { @@ -258,7 +258,7 @@ function ldapAuth(client, user, password, callback) { ldapclient.bind(bindDN, password, function(err) { if (!err && !client) { if (!manager.addUser(user, null)) { - console.log("Unable to create new user", user); + log.error("Unable to create new user", user); } } callback(!err);