From a2e89fde1acc5b189c55e0b8b38146194e455cd0 Mon Sep 17 00:00:00 2001 From: auth12 <67507608+auth12@users.noreply.github.com> Date: Mon, 27 Jul 2020 09:46:17 -0700 Subject: Removed spdlog, using fmt wrapper instead. More process class changes, support for 32/64bit processes. Injection process improvements. Other small changes. --- server/src/forum/forum.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'server/src/forum/forum.cpp') diff --git a/server/src/forum/forum.cpp b/server/src/forum/forum.cpp index a714cc6..e79f5e8 100644 --- a/server/src/forum/forum.cpp +++ b/server/src/forum/forum.cpp @@ -41,7 +41,7 @@ int xenforo_forum::check_login(const std::string_view username, auto json = nlohmann::json::parse(response); - if(!json.contains("user")) { + if (!json.contains("user")) { io::logger->error("json response for user {} doesn't contain user field.", username); return forum_response::api_fail; @@ -57,16 +57,30 @@ int xenforo_forum::check_login(const std::string_view username, auto custom_fields = user["custom_fields"]; + if(!user.contains("is_banned")) { + io::logger->error( + "json response for user {} doesn't contain is_banned.", username); + return forum_response::api_fail; + } + data.banned = user["is_banned"].get(); - // data.active = check user groupm - if (custom_fields.contains("hwid")) { - data.hwid = custom_fields["hwid"].get(); - } else { - io::logger->warn("hwid field doesn't exist for {}.", username); + + if(!user.contains("user_id")) { + io::logger->error( + "json response for user {} doesn't contain user_id.", username); + return forum_response::api_fail; } data.id = user["user_id"].get(); + if(!custom_fields.contains("hwid")) { + io::logger->error("custom fields for user {} dont contain hwid.", username); + return forum_response::api_fail; + } + + // data.active = check user group + data.hwid = custom_fields["hwid"].get(); + return forum_response::api_success; } -- cgit v1.2.3