From e7b22997c79cd1a4a8c62219df92d718bdf5b2f3 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Thu, 15 Aug 2013 19:39:05 -0500 Subject: [PATCH] Update acp.js to be compatible with new actionlog --- acp.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/acp.js b/acp.js index 124a0099..0f10c827 100644 --- a/acp.js +++ b/acp.js @@ -10,10 +10,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ var Auth = require("./auth"); -var ActionLog = require("./actionlog"); module.exports = function (Server) { var db = Server.db; + var ActionLog = require("./actionlog")(Server); return { init: function(user) { ActionLog.record(user.ip, user.name, "acp-init"); @@ -29,7 +29,7 @@ module.exports = function (Server) { }); user.socket.on("acp-global-ban", function(data) { - ActionLog.record(user.ip, user.name, "acp-global-ban", data.ip); + ActionLog.record(user.ip, user.name, "acp-global-ban", data.ip); db.setGlobalIPBan(data.ip, data.note, function (err, res) { db.listGlobalIPBans(function (err, res) { res = res || []; @@ -143,9 +143,10 @@ module.exports = function (Server) { }); user.socket.on("acp-actionlog-list", function () { - user.socket.emit("acp-actionlog-list", - ActionLog.getLogTypes() - ); + ActionLog.listActionTypes(function (err, types) { + if(!err) + user.socket.emit("acp-actionlog-list", types); + }); }); user.socket.on("acp-actionlog-clear", function(data) {