From: Maxim Mamontov Date: Thu, 25 Nov 2010 16:42:27 +0000 (+0200) Subject: При изменении пользователя через XML RPC добавлено изменение состояния X-Git-Tag: 2.407-rc3~355 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/77ba2f5a96084fa2eb6f52c7122b5ef32d326ef6 При изменении пользователя через XML RPC добавлено изменение состояния счета. Так-же исправлен тип данных о трафике (std::string, потому что XML RPC неуверенно работает с 64-битными целыми). --- diff --git a/projects/stargazer/plugins/configuration/rpcconfig/user_helper.cpp b/projects/stargazer/plugins/configuration/rpcconfig/user_helper.cpp index 62dcd1af..7f10eae4 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/user_helper.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/user_helper.cpp @@ -195,6 +195,18 @@ if ((it = structVal.find("email")) != structVal.end()) } } +if ((it = structVal.find("cash")) != structVal.end()) + { + bool res = iter->property.cash.Set(xmlrpc_c::value_double(it->second), + admin, + login, + &store); + if (!res) + { + return true; + } + } + if ((it = structVal.find("creditexpire")) != structVal.end()) { bool res = iter->property.creditExpire.Set(xmlrpc_c::value_int(it->second), @@ -231,7 +243,7 @@ if ((it = structVal.find("freemb")) != structVal.end()) } } -if ((it = structVal.find("disabled")) != structVal.end()) +if ((it = structVal.find("down")) != structVal.end()) { bool res = iter->property.disabled.Set(xmlrpc_c::value_boolean(it->second), admin, @@ -352,12 +364,11 @@ if ((it = structVal.find("traff")) != structVal.end()) static_cast >(xmlrpc_c::value_struct(it->second)) ); - std::vector data; DIR_TRAFF dtData; dtData = iter->property.up.Get(); if ((it = traff.find("mu")) != traff.end()) { - data = xmlrpc_c::value_array(it->second).vectorValueValue(); + std::vector data(xmlrpc_c::value_array(it->second).vectorValueValue()); for (int i = 0; i < std::min(DIR_NUM, static_cast(data.size())); ++i) { @@ -383,7 +394,7 @@ if ((it = structVal.find("traff")) != structVal.end()) dtData = iter->property.down.Get(); if ((it = traff.find("md")) != traff.end()) { - data = xmlrpc_c::value_array(it->second).vectorValueValue(); + std::vector data(xmlrpc_c::value_array(it->second).vectorValueValue()); for (int i = 0; i < std::min(DIR_NUM, static_cast(data.size())); ++i) {