]> git.stg.codes - stg.git/commitdiff
Уменьшена зависимость между заголовочными файлами путем использования
authorMaxim Mamontov <faust@gts.dp.ua>
Fri, 26 Nov 2010 15:04:51 +0000 (17:04 +0200)
committerMaxim Mamontov <faust@gts.dp.ua>
Fri, 26 Nov 2010 15:04:51 +0000 (17:04 +0200)
forward declaration.
Исправлена работа метода по изменению тарифа.

projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp
projects/stargazer/plugins/configuration/rpcconfig/users_methods.h

index d6812f55235cb9b841fa492bac8781b465df32e9..72fb399e313d204caad6924fb8af551499fb4bbe 100644 (file)
@@ -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;
+            }
         }
     }
 
index ee8e656ec1ad98d3dbf4dbf0a9e752f41716f9f5..956a2f190feabe552bf3a11a33384c27bd1490d7 100644 (file)
@@ -4,10 +4,13 @@
 #include <xmlrpc-c/base.hpp>
 #include <xmlrpc-c/registry.hpp>
 
-#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;
 };