X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/250a7d6e7a4c8ffd644931b7b3964289a8f99151..1c324d5b2380a68f209e65969079677dbaf1c511:/projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp?ds=sidebyside diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp index 5a101570..ccc86d8c 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp @@ -22,15 +22,16 @@ #include "stg/users.h" #include "stg/user.h" -#include "stg/common.h" #include // strcasecmp using STG::PARSER::USER_INFO; +const char * USER_INFO::tag = "GetUserInfo"; + int USER_INFO::Start(void * /*data*/, const char *el, const char **attr) { - if (strcasecmp(el, tag.c_str()) != 0) + if (strcasecmp(el, m_tag.c_str()) != 0) return -1; if (!attr[1]) @@ -42,19 +43,20 @@ int USER_INFO::Start(void * /*data*/, const char *el, const char **attr) void USER_INFO::CreateAnswer() { - CONST_USER_PTR u; + using ConstUserPtr = const User*; + ConstUserPtr u; if (m_users.FindByName(m_login, &u)) { - answer = ""; + m_answer = ""; return; } - answer = "GetAuthorizedModificationTime()) + "\"" + - " lastDisconnectTime=\"" + x2str(u->GetConnectedModificationTime()) + "\"" + + m_answer = "GetAuthorizedModificationTime()) + "\"" + + " lastDisconnectTime=\"" + std::to_string(u->GetConnectedModificationTime()) + "\"" + " connected=\"" + (u->GetConnected() ? "true" : "false") + "\"" + " lastDisconnectReason=\"" + u->GetLastDisconnectReason() + "\">"; std::vector list(u->GetAuthorizers()); for (std::vector::const_iterator it = list.begin(); it != list.end(); ++it) - answer += ""; - answer += ""; + m_answer += ""; + m_answer += ""; }