Do not load user commands or display them on --help if public mode or using LDAP

This commit is contained in:
Jérémie Astori 2017-12-06 21:28:21 -05:00
parent c038935b96
commit c21aee3d4a
No known key found for this signature in database
GPG Key ID: B9A4F245CD67BDE8
5 changed files with 6 additions and 16 deletions

View File

@ -51,7 +51,9 @@ Helper.setHome(home);
require("./start");
require("./config");
require("./users");
if (!Helper.config.public && !Helper.config.ldap.enable) {
require("./users");
}
require("./install");
// TODO: Remove this when releasing The Lounge v3

View File

@ -17,11 +17,6 @@ program
}
const ClientManager = require("../../clientManager");
if (Helper.config.public) {
log.warn(`Users have no effect in ${colors.bold("public")} mode.`);
}
const manager = new ClientManager();
const users = manager.getUsers();

View File

@ -18,8 +18,7 @@ program
}
const ClientManager = require("../../clientManager");
var users = new ClientManager().getUsers();
const users = new ClientManager().getUsers();
if (users === undefined) { // There was an error, already logged
return;

View File

@ -17,12 +17,7 @@ program
}
const ClientManager = require("../../clientManager");
if (Helper.config.public) {
log.warn(`Users have no effect in ${colors.bold("public")} mode.`);
}
var users = new ClientManager().getUsers();
const users = new ClientManager().getUsers();
if (users === undefined) { // There was an error, already logged
return;

View File

@ -17,8 +17,7 @@ program
}
const ClientManager = require("../../clientManager");
var users = new ClientManager().getUsers();
const users = new ClientManager().getUsers();
if (users === undefined) { // There was an error, already logged
return;