]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp
Add missing CMakeLists.txt
[stg.git] / projects / stargazer / plugins / configuration / sgconfig / parser_user_info.cpp
index 92e1170e07e1b22147681db43ed38d215012cb35..ccc86d8ce9f694267d49d7955571eb902022ed0d 100644 (file)
 
 #include "stg/users.h"
 #include "stg/user.h"
-#include "stg/common.h"
 
 #include <strings.h> // 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, m_tag.c_str()) != 0)
@@ -42,15 +43,16 @@ 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))
     {
         m_answer = "<UserInfo result=\"error\"/>";
         return;
     }
 
-    m_answer = "<UserInfo lastAuthTime=\"" + x2str(u->GetAuthorizedModificationTime()) + "\"" +
-             " lastDisconnectTime=\"" + x2str(u->GetConnectedModificationTime()) + "\"" +
+    m_answer = "<UserInfo lastAuthTime=\"" + std::to_string(u->GetAuthorizedModificationTime()) + "\"" +
+             " lastDisconnectTime=\"" + std::to_string(u->GetConnectedModificationTime()) + "\"" +
              " connected=\"" + (u->GetConnected() ? "true" : "false") + "\"" +
              " lastDisconnectReason=\"" + u->GetLastDisconnectReason() + "\">";
     std::vector<std::string> list(u->GetAuthorizers());