From: Maxim Mamontov Date: Fri, 26 Nov 2010 15:04:51 +0000 (+0200) Subject: Уменьшена зависимость между заголовочными файлами путем использования X-Git-Tag: 2.407-rc3~352 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/8ecd9d2cf879cfa584c387fc74343e9ea03f9c1d Уменьшена зависимость между заголовочными файлами путем использования forward declaration. Исправлена работа метода по изменению тарифа. --- diff --git a/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp b/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp index d6812f55..72fb399e 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp +++ b/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp @@ -1,10 +1,13 @@ #include "users_methods.h" +#include "../../../users.h" +#include "../../../admins.h" +#include "../../../tariffs.h" + #include "rpcconfig.h" #include "user_helper.h" #include "user_ips.h" #include "utils.h" - #include "common.h" //------------------------------------------------------------------------------ @@ -221,11 +224,11 @@ USER_HELPER uhelper(u); if (!adminInfo.priviledges.userConf || !adminInfo.priviledges.userPasswd) { - uhelper.SetUserInfo(info, admin, login, *store); + uhelper.SetUserInfo(info, admin, login, *store, tariffs); } else { - uhelper.SetUserInfo(info, admin, login, *store); + uhelper.SetUserInfo(info, admin, login, *store, tariffs); } u->WriteConf(); @@ -382,14 +385,17 @@ if (tariffs->FindByName(tariff)) return; } } - if (u->property.tariffName.Set(tariff, - admin, - login, - store)) + else { - u->WriteConf(); - *retvalPtr = xmlrpc_c::value_boolean(true); - return; + if (u->property.tariffName.Set(tariff, + admin, + login, + store)) + { + u->WriteConf(); + *retvalPtr = xmlrpc_c::value_boolean(true); + return; + } } } diff --git a/projects/stargazer/plugins/configuration/rpcconfig/users_methods.h b/projects/stargazer/plugins/configuration/rpcconfig/users_methods.h index ee8e656e..956a2f19 100644 --- a/projects/stargazer/plugins/configuration/rpcconfig/users_methods.h +++ b/projects/stargazer/plugins/configuration/rpcconfig/users_methods.h @@ -4,10 +4,13 @@ #include #include -#include "../../../users.h" -#include "../../../user.h" class RPC_CONFIG; +class ADMINS; +class TARIFFS; +class USERS; +class BASE_STORE; +class IP_MASK; class METHOD_USER_GET : public xmlrpc_c::method { public: @@ -83,10 +86,12 @@ class METHOD_USER_CHG : public xmlrpc_c::method { public: METHOD_USER_CHG(RPC_CONFIG * c, ADMINS * a, + TARIFFS * t, BASE_STORE * s, USERS * u) : config(c), admins(a), + tariffs(t), store(s), users(u) { @@ -97,6 +102,7 @@ public: private: RPC_CONFIG * config; ADMINS * admins; + TARIFFS * tariffs; BASE_STORE * store; USERS * users; };