diff --git a/user.js b/user.js index 810c5dd9..6191d1d1 100644 --- a/user.js +++ b/user.js @@ -17,6 +17,7 @@ var Server = require("./server.js"); var Database = require("./database.js"); var Logger = require("./logger.js"); var Config = require("./config.js"); +var ACP = require("./acp"); // Represents a client connected via socket.io var User = function(socket, ip) { @@ -24,6 +25,7 @@ var User = function(socket, ip) { this.socket = socket; this.loggedIn = false; this.rank = Rank.Anonymous; + this.global_rank = Rank.Anonymous; this.channel = null; this.name = ""; this.meta = { @@ -514,6 +516,11 @@ User.prototype.initCallbacks = function() { pllist: list, }); }.bind(this)); + + this.socket.on("acp-init", function() { + if(this.global_rank >= Rank.Siteadmin) + ACP.init(this); + }.bind(this)); } var lastguestlogin = {}; @@ -603,6 +610,7 @@ User.prototype.login = function(name, pw, session) { var rank = (chanrank > row.global_rank) ? chanrank : row.global_rank; this.rank = (this.rank > rank) ? this.rank : rank; + this.global_rank = row.global_rank; this.socket.emit("rank", this.rank); this.name = name; if(this.channel != null) { diff --git a/www/acp.html b/www/acp.html index dd4de0a4..19b4f7da 100644 --- a/www/acp.html +++ b/www/acp.html @@ -13,13 +13,6 @@ body { padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */ } - .loginform { - margin: 100px auto 20px; - padding: 19px 29px 29px; - border-radius: 5px 5px 5px 5px; - border: 1px solid #dedede; - max-width: 300px; - } #log { max-height: 500px; @@ -39,9 +32,14 @@