3 #include "base_plugin.h"
4 #include "base_store.h"
5 #include "configproto.h"
6 //#include "user_ips.h"
7 //#include "../../../users.h"
11 extern "C" BASE_PLUGIN * GetPlugin();
15 //-----------------------------------------------------------------------------
16 /*template <typename varParamType>
17 class CHG_BEFORE_NOTIFIER: public PROPERTY_NOTIFIER_BASE<varParamType>
20 void Notify(const varParamType & oldValue, const varParamType & newValue)
22 auth->Unauthorize(user);
24 void SetUser(USER * u) { user = u; }
25 void SetAuthorizaror(const AUTH_AO * a) { auth = a; }
31 //-----------------------------------------------------------------------------
32 template <typename varParamType>
33 class CHG_AFTER_NOTIFIER: public PROPERTY_NOTIFIER_BASE<varParamType>
36 void Notify(const varParamType & oldValue, const varParamType & newValue)
38 auth->UpdateUserAuthorization(user);
40 void SetUser(USER * u) { user = u; }
41 void SetAuthorizaror(const AUTH_AO * a) { auth = a; }
47 //-----------------------------------------------------------------------------
48 class STG_CONFIG_SETTINGS
51 STG_CONFIG_SETTINGS();
52 virtual ~STG_CONFIG_SETTINGS(){};
53 const string & GetStrError() const;
54 int ParseSettings(const MODULE_SETTINGS & s);
57 int ParseIntInRange(const string & str, int min, int max, int * val);
61 //-----------------------------------------------------------------------------
62 class STG_CONFIG :public BASE_PLUGIN
66 virtual ~STG_CONFIG(){};
68 void SetUsers(USERS * u);
69 void SetTariffs(TARIFFS * t);
70 void SetAdmins(ADMINS * a);
71 void SetStore(BASE_STORE * s);
72 void SetTraffcounter(TRAFFCOUNTER *){};
73 void SetStgSettings(const SETTINGS * s);
74 void SetSettings(const MODULE_SETTINGS & s);
79 int Reload() { return 0; };
82 const string & GetStrError() const;
83 const string GetVersion() const;
84 uint16_t GetStartPosition() const;
85 uint16_t GetStopPosition() const;
88 static void * Run(void *);
89 mutable string errorStr;
90 STG_CONFIG_SETTINGS stgConfigSettings;
99 MODULE_SETTINGS settings;
100 const SETTINGS * stgSettings;
102 //-----------------------------------------------------------------------------