diff --git a/src/acp.js b/src/acp.js index e7ebe224..14dc37ac 100644 --- a/src/acp.js +++ b/src/acp.js @@ -91,15 +91,10 @@ function handleGlobalBanDelete(user, data) { } function handleListUsers(user, data) { - var query = data.query; - if (typeof query !== "string") { - query = ""; - } - + var value = data.value; var field = data.field; - if (typeof field !== "string") { - field = "name"; - } + value = (typeof value !== 'string') ? '' : value; + field = (typeof field !== 'string') ? 'name' : field; var fields = ["id", "name", "global_rank", "email", "ip", "time"]; @@ -110,7 +105,7 @@ function handleListUsers(user, data) { return; } - db.users.search(field, query, fields, function (err, users) { + db.users.search(field, value, fields, function (err, users) { if (err) { user.socket.emit("errMessage", { msg: err diff --git a/www/js/acp.js b/www/js/acp.js index 52ec737f..e9eef7f3 100644 --- a/www/js/acp.js +++ b/www/js/acp.js @@ -143,7 +143,7 @@ socket.on("acp-gbanlist", function (bans) { } } socket.emit("acp-list-users", { - query: $("#acp-ulookup-query").val(), + value: $("#acp-ulookup-query").val(), field: $(this).data()["field"] }); };