]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/configuration/rpcconfig/info_methods.cpp
Disable cppcheck for foreign libs by default.
[stg.git] / projects / stargazer / plugins / configuration / rpcconfig / info_methods.cpp
index a689cd99de2fa8370c7e791ca771aa78ed003dfd..e0c371cde1db11ada4ca53000fd59833466b1a02 100644 (file)
@@ -1,9 +1,15 @@
-#include <sys/utsname.h>
-
 #include "info_methods.h"
 #include "info_methods.h"
-#include "version.h"
 #include "rpcconfig.h"
 #include "rpcconfig.h"
-#include "common.h"
+
+#include "stg/users.h"
+#include "stg/tariffs.h"
+#include "stg/version.h"
+#include "stg/common.h"
+#include "stg/const.h"
+
+#include <ostream> // xmlrpc-c devs have missed something :)
+
+#include <sys/utsname.h>
 
 void METHOD_INFO::execute(xmlrpc_c::paramList const & paramList,
                           xmlrpc_c::value *   const   retvalPtr)
 
 void METHOD_INFO::execute(xmlrpc_c::paramList const & paramList,
                           xmlrpc_c::value *   const   retvalPtr)
@@ -26,20 +32,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++)
     {
-    std::string dn2e;
-    Encode12str(dn2e, dirNames[i]);
-    dirnameVal.push_back(xmlrpc_c::value_string(dn2e));
+    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);
@@ -77,8 +81,6 @@ void METHOD_LOGOUT::execute(xmlrpc_c::paramList const & paramList,
 std::string cookie = paramList.getString(0);
 paramList.verifyEnd(1);
 
 std::string cookie = paramList.getString(0);
 paramList.verifyEnd(1);
 
-std::map<std::string, xmlrpc_c::value> structVal;
-
 if (config->LogoutAdmin(cookie))
     {
     *retvalPtr = xmlrpc_c::value_boolean(false);
 if (config->LogoutAdmin(cookie))
     {
     *retvalPtr = xmlrpc_c::value_boolean(false);