X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/91b5ae18ae465d0887785aab6dc0eb7abc0d5488..8c7a6befad791ac242f15233365893b18953a627:/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp?ds=inline diff --git a/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp b/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp index 10985cce..2047202a 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/tariffs_methods.cpp @@ -1,10 +1,15 @@ -#include "rpcconfig.h" +#include // xmlrpc-c devs have missed something :) + #include "tariffs_methods.h" +#include "rpcconfig.h" #include "tariff_helper.h" -#include "tariffs.h" -#include "users.h" -#include "admins.h" -#include "admin.h" + +#include "stg/tariffs.h" +#include "stg/tariff.h" +#include "stg/tariff_conf.h" +#include "stg/users.h" +#include "stg/admins.h" +#include "stg/admin.h" void METHOD_TARIFF_GET::execute(xmlrpc_c::paramList const & paramList, xmlrpc_c::value * const retvalPtr) @@ -23,7 +28,7 @@ if (config->GetAdminInfo(cookie, &adminInfo)) return; } -const TARIFF * tariff = tariffs->FindByName(name); +const auto tariff = tariffs->FindByName(name); if (!tariff) { @@ -32,7 +37,7 @@ if (!tariff) return; } -TARIFF_DATA td(tariff->GetTariffData()); +auto td = tariff->GetTariffData(); TARIFF_HELPER helper(td); @@ -55,15 +60,15 @@ if (config->GetAdminInfo(cookie, &adminInfo)) return; } -ADMIN * admin; +STG::Admin * admin; -if (admins->FindAdmin(adminInfo.admin, &admin)) +if (admins->find(adminInfo.admin, &admin)) { *retvalPtr = xmlrpc_c::value_boolean(false); return; } -const TARIFF * tariff = tariffs->FindByName(name); +const auto tariff = tariffs->FindByName(name); if (!tariff) { @@ -71,7 +76,7 @@ if (!tariff) return; } -TARIFF_DATA td(tariff->GetTariffData()); +auto td = tariff->GetTariffData(); TARIFF_HELPER helper(td); @@ -105,13 +110,13 @@ if (config->GetAdminInfo(cookie, &adminInfo)) std::vector tariffsInfo; -std::list dataList; +std::vector dataList; tariffs->GetTariffsData(&dataList); -std::list::const_iterator it = dataList.begin(); +auto it = dataList.begin(); for (; it != dataList.end(); ++it) { xmlrpc_c::value info; - TARIFF_DATA td(*it); // 'cause TARIFF_HELPER work in both ways and take not const referense + auto td = *it; // 'cause TARIFF_HELPER work in both ways and take not const referense TARIFF_HELPER helper(td); helper.GetTariffInfo(&info); tariffsInfo.push_back(info); @@ -125,7 +130,6 @@ void METHOD_TARIFF_ADD::execute(xmlrpc_c::paramList const & paramList, { std::string cookie = paramList.getString(0); std::string tariff = paramList.getString(1); -std::string enc; paramList.verifyEnd(2); ADMIN_INFO adminInfo; @@ -136,9 +140,9 @@ if (config->GetAdminInfo(cookie, &adminInfo)) return; } -ADMIN * admin; +STG::Admin * admin; -if (admins->FindAdmin(adminInfo.admin, &admin)) +if (admins->find(adminInfo.admin, &admin)) { *retvalPtr = xmlrpc_c::value_boolean(false); return; @@ -168,9 +172,9 @@ if (config->GetAdminInfo(cookie, &adminInfo)) return; } -ADMIN * admin; +STG::Admin * admin; -if (admins->FindAdmin(adminInfo.admin, &admin)) +if (admins->find(adminInfo.admin, &admin)) { *retvalPtr = xmlrpc_c::value_boolean(false); return;