]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/configuration/rpcconfig/users_methods.h
Fight CLang warnings.
[stg.git] / projects / stargazer / plugins / configuration / rpcconfig / users_methods.h
index ee8e656ec1ad98d3dbf4dbf0a9e752f41716f9f5..bd17c4567e0323d4afa179c684f495b9736f5c0d 100644 (file)
@@ -1,18 +1,25 @@
-#ifndef __USERS_METHODS_H__
-#define __USERS_METHODS_H__
+#pragma once
 
 #include <xmlrpc-c/base.hpp>
 #include <xmlrpc-c/registry.hpp>
 
-#include "../../../users.h"
-#include "../../../user.h"
+namespace STG
+{
+
+struct Admins;
+class Tariffs;
+class Users;
+struct Store;
+struct IPMask;
+
+}
 
 class RPC_CONFIG;
 
 class METHOD_USER_GET : public xmlrpc_c::method {
 public:
     METHOD_USER_GET(RPC_CONFIG * c,
-                    USERS * u)
+                    STG::Users * u)
         : config(c),
           users(u)
     {
@@ -20,16 +27,20 @@ public:
 
     void execute(xmlrpc_c::paramList const & paramList,
                  xmlrpc_c::value *   const   retvalP);
+
 private:
+    METHOD_USER_GET(const METHOD_USER_GET & rvalue);
+    METHOD_USER_GET & operator=(const METHOD_USER_GET & rvalue);
+
     RPC_CONFIG * config;
-    USERS * users;
+    STG::Users * users;
 };
 
 class METHOD_USER_ADD : public xmlrpc_c::method {
 public:
     METHOD_USER_ADD(RPC_CONFIG * c,
-                    ADMINS * a,
-                    USERS * u)
+                    STG::Admins * a,
+                    STG::Users * u)
         : config(c),
           admins(a),
           users(u)
@@ -38,17 +49,21 @@ public:
 
     void execute(xmlrpc_c::paramList const & paramList,
                  xmlrpc_c::value *   const   retvalP);
+
 private:
+    METHOD_USER_ADD(const METHOD_USER_ADD & rvalue);
+    METHOD_USER_ADD & operator=(const METHOD_USER_ADD & rvalue);
+
     RPC_CONFIG * config;
-    ADMINS * admins;
-    USERS * users;
+    STG::Admins * admins;
+    STG::Users * users;
 };
 
 class METHOD_USER_DEL : public xmlrpc_c::method {
 public:
     METHOD_USER_DEL(RPC_CONFIG * c,
-                    ADMINS * a,
-                    USERS * u)
+                    STG::Admins * a,
+                    STG::Users * u)
         : config(c),
           admins(a),
           users(u)
@@ -57,16 +72,20 @@ public:
 
     void execute(xmlrpc_c::paramList const & paramList,
                  xmlrpc_c::value *   const   retvalP);
+
 private:
+    METHOD_USER_DEL(const METHOD_USER_DEL & rvalue);
+    METHOD_USER_DEL & operator=(const METHOD_USER_DEL & rvalue);
+
     RPC_CONFIG * config;
-    ADMINS * admins;
-    USERS * users;
+    STG::Admins * admins;
+    STG::Users * users;
 };
 
 class METHOD_USERS_GET : public xmlrpc_c::method {
 public:
     METHOD_USERS_GET(RPC_CONFIG * c,
-                     USERS * u)
+                     STG::Users * u)
         : config(c),
           users(u)
     {
@@ -74,19 +93,25 @@ public:
 
     void execute(xmlrpc_c::paramList const & paramList,
                  xmlrpc_c::value *   const   retvalP);
+
 private:
+    METHOD_USERS_GET(const METHOD_USERS_GET & rvalue);
+    METHOD_USERS_GET & operator=(const METHOD_USERS_GET & rvalue);
+
     RPC_CONFIG * config;
-    USERS * users;
+    STG::Users * users;
 };
 
 class METHOD_USER_CHG : public xmlrpc_c::method {
 public:
     METHOD_USER_CHG(RPC_CONFIG * c,
-                    ADMINS * a,
-                    BASE_STORE * s,
-                    USERS * u)
+                    STG::Admins * a,
+                    STG::Tariffs * t,
+                    STG::Store * s,
+                    STG::Users * u)
         : config(c),
           admins(a),
+          tariffs(t),
           store(s),
           users(u)
     {
@@ -94,19 +119,24 @@ public:
 
     void execute(xmlrpc_c::paramList const & paramList,
                  xmlrpc_c::value *   const   retvalP);
+
 private:
+    METHOD_USER_CHG(const METHOD_USER_CHG & rvalue);
+    METHOD_USER_CHG & operator=(const METHOD_USER_CHG & rvalue);
+
     RPC_CONFIG * config;
-    ADMINS * admins;
-    BASE_STORE * store;
-    USERS * users;
+    STG::Admins * admins;
+    STG::Tariffs * tariffs;
+    STG::Store * store;
+    STG::Users * users;
 };
 
 class METHOD_USER_CASH_ADD : public xmlrpc_c::method {
 public:
     METHOD_USER_CASH_ADD(RPC_CONFIG * c,
-                         ADMINS * a,
-                         BASE_STORE * s,
-                         USERS * u)
+                         STG::Admins * a,
+                         STG::Store * s,
+                         STG::Users * u)
         : config(c),
           admins(a),
           store(s),
@@ -116,19 +146,23 @@ public:
 
     void execute(xmlrpc_c::paramList const & paramList,
                  xmlrpc_c::value *   const   retvalP);
+
 private:
+    METHOD_USER_CASH_ADD(const METHOD_USER_CASH_ADD & rvalue);
+    METHOD_USER_CASH_ADD & operator=(const METHOD_USER_CASH_ADD & rvalue);
+
     RPC_CONFIG * config;
-    ADMINS * admins;
-    BASE_STORE * store;
-    USERS * users;
+    STG::Admins * admins;
+    STG::Store * store;
+    STG::Users * users;
 };
 
 class METHOD_USER_CASH_SET : public xmlrpc_c::method {
 public:
     METHOD_USER_CASH_SET(RPC_CONFIG * c,
-                         ADMINS * a,
-                         BASE_STORE * s,
-                         USERS * u)
+                         STG::Admins * a,
+                         STG::Store * s,
+                         STG::Users * u)
         : config(c),
           admins(a),
           store(s),
@@ -138,20 +172,24 @@ public:
 
     void execute(xmlrpc_c::paramList const & paramList,
                  xmlrpc_c::value *   const   retvalP);
+
 private:
+    METHOD_USER_CASH_SET(const METHOD_USER_CASH_SET & rvalue);
+    METHOD_USER_CASH_SET & operator=(const METHOD_USER_CASH_SET & rvalue);
+
     RPC_CONFIG * config;
-    ADMINS * admins;
-    BASE_STORE * store;
-    USERS * users;
+    STG::Admins * admins;
+    STG::Store * store;
+    STG::Users * users;
 };
 
 class METHOD_USER_TARIFF_CHANGE : public xmlrpc_c::method {
 public:
     METHOD_USER_TARIFF_CHANGE(RPC_CONFIG * c,
-                              ADMINS * a,
-                              TARIFFS * t,
-                              BASE_STORE * s,
-                              USERS * u)
+                              STG::Admins * a,
+                              STG::Tariffs * t,
+                              STG::Store * s,
+                              STG::Users * u)
         : config(c),
           admins(a),
           tariffs(t),
@@ -162,18 +200,22 @@ public:
 
     void execute(xmlrpc_c::paramList const & paramList,
                  xmlrpc_c::value *   const   retvalP);
+
 private:
+    METHOD_USER_TARIFF_CHANGE(const METHOD_USER_TARIFF_CHANGE & rvalue);
+    METHOD_USER_TARIFF_CHANGE & operator=(const METHOD_USER_TARIFF_CHANGE & rvalue);
+
     RPC_CONFIG * config;
-    ADMINS * admins;
-    TARIFFS * tariffs;
-    BASE_STORE * store;
-    USERS * users;
+    STG::Admins * admins;
+    STG::Tariffs * tariffs;
+    STG::Store * store;
+    STG::Users * users;
 };
 
 class METHOD_GET_ONLINE_IPS : public xmlrpc_c::method {
 public:
     METHOD_GET_ONLINE_IPS(RPC_CONFIG * c,
-                          USERS * u)
+                          STG::Users * u)
         : config(c),
           users(u)
     {
@@ -181,11 +223,33 @@ public:
 
     void execute(xmlrpc_c::paramList const & paramList,
                  xmlrpc_c::value *   const   retvalP);
+
 private:
+    METHOD_GET_ONLINE_IPS(const METHOD_GET_ONLINE_IPS & rvalue);
+    METHOD_GET_ONLINE_IPS & operator=(const METHOD_GET_ONLINE_IPS & rvalue);
+
     RPC_CONFIG * config;
-    USERS * users;
+    STG::Users * users;
 
-    bool ParseNet(const std::string & net, IP_MASK & ipm) const;
+    bool ParseNet(const std::string & net, STG::IPMask & ipm) const;
 };
 
-#endif
+class METHOD_GET_USER_AUTH_BY : public xmlrpc_c::method {
+public:
+    METHOD_GET_USER_AUTH_BY(RPC_CONFIG * c,
+                            STG::Users * u)
+        : config(c),
+          users(u)
+    {
+    }
+
+    void execute(xmlrpc_c::paramList const & paramList,
+                 xmlrpc_c::value *   const   retvalP);
+
+private:
+    METHOD_GET_USER_AUTH_BY(const METHOD_GET_ONLINE_IPS & rvalue);
+    METHOD_GET_USER_AUTH_BY & operator=(const METHOD_GET_ONLINE_IPS & rvalue);
+
+    RPC_CONFIG * config;
+    STG::Users * users;
+};