]> git.stg.codes - stg.git/commitdiff
Fixed parsers.
authorMaxim Mamontov <faust.madf@gmail.com>
Sun, 25 Oct 2015 16:45:42 +0000 (18:45 +0200)
committerMaxim Mamontov <faust.madf@gmail.com>
Sun, 25 Oct 2015 16:45:42 +0000 (18:45 +0200)
projects/stargazer/plugins/configuration/sgconfig/parser_server_info.cpp
projects/stargazer/plugins/configuration/sgconfig/parser_users.cpp

index 1873b9bbc14db47a86629848aaf9415d5be96a4f..75be7537ba85359cdc27aed00bd533c68d01b626 100644 (file)
@@ -46,7 +46,7 @@ void GET_SERVER_INFO::CreateAnswer()
                        utsn.machine + " " +
                        utsn.nodename;
 
                        utsn.machine + " " +
                        utsn.nodename;
 
-    m_answer = GetOpenTag() + "<version value=\"" + SERVER_VERSION + "\"/>" +
+    m_answer = std::string("<ServerInfo><version value=\"") + SERVER_VERSION + "\"/>" +
                "<tariff_num value=\"" + x2str(m_tariffs.Count()) + "\"/>" +
                "<tariff value=\"2\"/>" +
                "<user_num value=\"" + x2str(m_users.Count()) + "\"/>" +
                "<tariff_num value=\"" + x2str(m_tariffs.Count()) + "\"/>" +
                "<tariff value=\"2\"/>" +
                "<user_num value=\"" + x2str(m_users.Count()) + "\"/>" +
@@ -57,5 +57,5 @@ void GET_SERVER_INFO::CreateAnswer()
     for (size_t i = 0; i< DIR_NUM; i++)
         m_answer += "<dir_name_" + x2str(i) + " value=\"" + Encode12str(m_settings.GetDirName(i)) + "\"/>";
 
     for (size_t i = 0; i< DIR_NUM; i++)
         m_answer += "<dir_name_" + x2str(i) + " value=\"" + Encode12str(m_settings.GetDirName(i)) + "\"/>";
 
-    m_answer += GetCloseTag();
+    m_answer += "</ServerInfo>";
 }
 }
index c54ae8eb95aa9a1b03bcdbb2426e7eeea99d0232..2e9d70872a82e3a7ac1ff92236c36c306060d582 100644 (file)
@@ -52,9 +52,9 @@ std::string UserToXML(const USER & user, bool loginInStart, bool showPass, time_
     std::string answer;
 
     if (loginInStart)
     std::string answer;
 
     if (loginInStart)
-        answer += "<User result=\"ok\">";
+        answer += "<User login=\"" + user.GetLogin() + "\" result=\"ok\">";
     else
     else
-        answer += "<User result=\"ok\" login=\"" + user.GetLogin() + "\">";
+        answer += "<User result=\"ok\">";
 
     answer += "<Login value=\"" + user.GetLogin() + "\"/>";
 
 
     answer += "<Login value=\"" + user.GetLogin() + "\"/>";