From 8ecd9d2cf879cfa584c387fc74343e9ea03f9c1d Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Fri, 26 Nov 2010 17:04:51 +0200 Subject: [PATCH 1/1] =?utf8?q?=D0=A3=D0=BC=D0=B5=D0=BD=D1=8C=D1=88=D0=B5?= =?utf8?q?=D0=BD=D0=B0=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC=D0=BE?= =?utf8?q?=D1=81=D1=82=D1=8C=20=D0=BC=D0=B5=D0=B6=D0=B4=D1=83=20=D0=B7?= =?utf8?q?=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2=D0=BE=D1=87=D0=BD=D1=8B?= =?utf8?q?=D0=BC=D0=B8=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0=D0=BC=D0=B8=20?= =?utf8?q?=D0=BF=D1=83=D1=82=D0=B5=D0=BC=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB?= =?utf8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20forward=20dec?= =?utf8?q?laration.=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BC?= =?utf8?q?=D0=B5=D1=82=D0=BE=D0=B4=D0=B0=20=D0=BF=D0=BE=20=D0=B8=D0=B7?= =?utf8?q?=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D1=8E=20=D1=82=D0=B0=D1=80?= =?utf8?q?=D0=B8=D1=84=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../configuration/rpcconfig/users_methods.cpp | 26 ++++++++++++------- .../configuration/rpcconfig/users_methods.h | 10 +++++-- 2 files changed, 24 insertions(+), 12 deletions(-) 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; }; -- 2.44.2