]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/configuration/rpcconfig/info_methods.cpp
Fixed error handling in SetUser.
[stg.git] / projects / stargazer / plugins / configuration / rpcconfig / info_methods.cpp
index 11cf970caa3bd5ed92fb34e9075efdfeb916153c..895088dc3482dcbc9c3a21c26697bebb3eb70bbe 100644 (file)
@@ -1,5 +1,7 @@
 #include <sys/utsname.h>
 
 #include <sys/utsname.h>
 
+#include <ostream> // xmlrpc-c devs have missed something :)
+
 #include "stg/version.h"
 #include "stg/common.h"
 #include "info_methods.h"
 #include "stg/version.h"
 #include "stg/common.h"
 #include "info_methods.h"
@@ -26,18 +28,18 @@ un += " ";
 un += utsn.nodename;
 
 structVal["version"] = xmlrpc_c::value_string(SERVER_VERSION);
 un += utsn.nodename;
 
 structVal["version"] = xmlrpc_c::value_string(SERVER_VERSION);
-structVal["tariff_num"] = xmlrpc_c::value_int(tariffs->GetTariffsNum());
+structVal["tariff_num"] = xmlrpc_c::value_int(static_cast<int>(tariffs->Count()));
 structVal["tariff"] = xmlrpc_c::value_int(2);
 structVal["tariff"] = xmlrpc_c::value_int(2);
-structVal["users_num"] = xmlrpc_c::value_int(users->GetUserNum());
+structVal["users_num"] = xmlrpc_c::value_int(static_cast<int>(users->Count()));
 structVal["uname"] = xmlrpc_c::value_string(un);
 structVal["dir_num"] = xmlrpc_c::value_int(DIR_NUM);
 structVal["uname"] = xmlrpc_c::value_string(un);
 structVal["dir_num"] = xmlrpc_c::value_int(DIR_NUM);
-structVal["day_fee"] = xmlrpc_c::value_int(dayFee);
+structVal["day_fee"] = xmlrpc_c::value_int(static_cast<int>(dayFee));
 
 std::vector<xmlrpc_c::value> dirnameVal;
 
 for (int i = 0; i< DIR_NUM; i++)
     {
 
 std::vector<xmlrpc_c::value> dirnameVal;
 
 for (int i = 0; i< DIR_NUM; i++)
     {
-    dirnameVal.push_back(xmlrpc_c::value_string(dirNames[i]));
+    dirnameVal.push_back(xmlrpc_c::value_string(IconvString(dirNames[i], "KOI8-RU", "UTF-8")));
     }
 
 structVal["dir_names"] = xmlrpc_c::value_array(dirnameVal);
     }
 
 structVal["dir_names"] = xmlrpc_c::value_array(dirnameVal);