]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/configuration/sgconfig/parser_user_info.cpp
Fixed encryption in srvconf.lib
[stg.git] / projects / stargazer / plugins / configuration / sgconfig / parser_user_info.cpp
index 72c3c6ece73ff36695c338822a6d16ca4105479b..de28eaba925b1b15ef8054a5d1bc0b170a001666 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "parser_user_info.h"
 
 
 #include "parser_user_info.h"
 
+#include "stg/users.h"
 #include "stg/user.h"
 #include "stg/common.h"
 
 #include "stg/user.h"
 #include "stg/common.h"
 
@@ -49,22 +50,19 @@ return 0;
 
 void PARSER_USER_INFO::CreateAnswer()
 {
 
 void PARSER_USER_INFO::CreateAnswer()
 {
-answerList->clear();
-
 CONST_USER_PTR u;
 if (users->FindByName(login, &u))
     {
 CONST_USER_PTR u;
 if (users->FindByName(login, &u))
     {
-    answerList->push_back("<UserInfo result=\"error\"/>");
+    answer = "<UserInfo result=\"error\"/>";
     return;
     }
 
     return;
     }
 
-std::string s = "<UserInfo lastAuthTime=\"" + x2str(u->GetAuthorizedModificationTime()) + "\"" +
-                " lastDisconnectTime=\"" + x2str(u->GetConnectedModificationTime()) + "\"" +
-                " connected=\"" + (u->GetConnected() ? "true" : "false") + "\"" +
-                " lastDisconnectReason=\"" + u->GetLastDisconnectReason() + "\">";
+answer = "<UserInfo lastAuthTime=\"" + x2str(u->GetAuthorizedModificationTime()) + "\"" +
+         " lastDisconnectTime=\"" + x2str(u->GetConnectedModificationTime()) + "\"" +
+         " connected=\"" + (u->GetConnected() ? "true" : "false") + "\"" +
+         " lastDisconnectReason=\"" + u->GetLastDisconnectReason() + "\">";
 std::vector<std::string> list(u->GetAuthorizers());
 for (std::vector<std::string>::const_iterator it = list.begin(); it != list.end(); ++it)
 std::vector<std::string> list(u->GetAuthorizers());
 for (std::vector<std::string>::const_iterator it = list.begin(); it != list.end(); ++it)
-    s += "<Auth name=\"" + *it + "\"/>";
-s += "</UserInfo>";
-answerList->push_back(s);
+    answer += "<Auth name=\"" + *it + "\"/>";
+answer += "</UserInfo>";
 }
 }