diff --git a/client/js/lounge.js b/client/js/lounge.js index 307de2ac..fdeeba13 100644 --- a/client/js/lounge.js +++ b/client/js/lounge.js @@ -15,7 +15,6 @@ const templates = require("../views"); const socket = require("./socket"); require("./socket-events"); const storage = require("./localStorage"); -require("./options"); const utils = require("./utils"); require("./autocompletion"); require("./webpush"); diff --git a/client/js/socket-events/configuration.js b/client/js/socket-events/configuration.js new file mode 100644 index 00000000..d7a769a7 --- /dev/null +++ b/client/js/socket-events/configuration.js @@ -0,0 +1,14 @@ +"use strict"; + +const $ = require("jquery"); +const socket = require("../socket"); +const storage = require("../localStorage"); +const utils = require("../utils"); +const templates = require("../../views"); + +socket.on("configuration", function(data) { + $("#settings").html(templates.windows.settings(data)); + $("#connect").html(templates.windows.connect(data)); + + require("../options"); +}); diff --git a/client/js/socket-events/index.js b/client/js/socket-events/index.js index b0064665..f14c670a 100644 --- a/client/js/socket-events/index.js +++ b/client/js/socket-events/index.js @@ -18,3 +18,4 @@ require("./topic"); require("./users"); require("./sign_out"); require("./sessions_list"); +require("./configuration"); diff --git a/client/views/windows/settings.tpl b/client/views/windows/settings.tpl index ec314752..c78ed80b 100644 --- a/client/views/windows/settings.tpl +++ b/client/views/windows/settings.tpl @@ -145,7 +145,7 @@ {{#unless public}} - {{#unless ldap.enable}} + {{#unless ldapEnabled}}
diff --git a/src/server.js b/src/server.js index ca29b286..fe23357f 100644 --- a/src/server.js +++ b/src/server.js @@ -467,6 +467,22 @@ function initializeClient(socket, client, token, lastMessage) { } } +function getClientConfiguration() { + const config = _.pick(Helper.config, [ + "public", + "lockNetwork", + "displayNetwork", + "useHexIp", + "defaults", + "themes", + "prefetch", + ]); + + config.ldapEnabled = Helper.config.ldap.enable; + + return config; +} + function performAuthentication(data) { const socket = this; let client; @@ -474,6 +490,8 @@ function performAuthentication(data) { const finalInit = () => initializeClient(socket, client, data.token || null, data.lastMessage || -1); const initClient = () => { + socket.emit("configuration", getClientConfiguration()); + client.ip = getClientIp(socket); // If webirc is enabled perform reverse dns lookup