Update acp.js to be compatible with new actionlog

This commit is contained in:
calzoneman 2013-08-15 19:39:05 -05:00
parent b342be50a3
commit e7b22997c7
1 changed files with 6 additions and 5 deletions

9
acp.js
View File

@ -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");
@ -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) {