SRCS = ./admin_impl.cpp \
./admins_impl.cpp \
+ ./eventloop.cpp \
./main.cpp \
- ./settings.cpp \
+ ./pidfile.cpp \
+ ./plugin_runner.cpp \
+ ./settings_impl.cpp \
./stg_timer.cpp \
+ ./store_loader.cpp \
./tariff_impl.cpp \
./tariffs_impl.cpp \
./traffcounter.cpp \
./user_impl.cpp \
./user_property.cpp \
- ./users_impl.cpp \
- ./plugin_runner.cpp \
- ./store_loader.cpp \
- ./pidfile.cpp \
- ./eventloop.cpp
+ ./users_impl.cpp
STGLIBS = -lstg_logger \
-lstg_locker \
$Author: faust $
*/
-//#include <stdio.h>
-#include <sys/types.h>
+/*#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
-#include <arpa/inet.h>
+#include <arpa/inet.h>*/
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/msg.h>
-#include <sys/stat.h>
+#include <sys/types.h>
#include <sys/wait.h>
+/*#include <sys/stat.h>
#include <dlfcn.h>
-#include <fcntl.h>
+#include <fcntl.h>*/
#include <csignal>
#include <cerrno>
#include <set>
#include <list>
-#include "settings.h"
+#include "settings_impl.h"
#include "user.h"
#include "users_impl.h"
#include "admins_impl.h"
return;
}
//-----------------------------------------------------------------------------
-int StartScriptExecuter(char * procName, int msgKey, int * msgID, SETTINGS * settings)
+int StartScriptExecuter(char * procName, int msgKey, int * msgID, SETTINGS_IMPL * settings)
{
STG_LOGGER & WriteServLog = GetStgLogger();
{
for (int i = 0; i < 2; i++)
{
- //WriteServLog("Creating queue with key=%d ...", msgKey);
*msgID = msgget(msgKey, IPC_CREAT | IPC_EXCL | 0600);
if (*msgID == -1)
else
{
msgctl(*msgID, IPC_RMID, NULL);
- //printfd(__FILE__, "Queue removed!");
}
}
else
switch (executerPid)
{
- case -1: // ìÁÖÁ
+ case -1:
WriteServLog("Fork error!");
return -1;
- case 0: // ðÏÔÏÍÏË
- //close(0);
- //close(1);
- //close(2);
- //setsid();
+ case 0:
delete settings;
Executer(msgKey, *msgID, executerPid, procName);
return 1;
- default: // ïÓÎÏ×ÎÏÊ ÐÒÏÃÅÓÓ
+ default:
if (executersPid.empty()) {
Executer(msgKey, *msgID, executerPid, NULL);
}
switch (stgChildPid)
{
- case -1: // ìÁÖÁ
+ case -1:
return -1;
break;
- case 0: // ðÏÔÏÍÏË
- //close(0);
+ case 0:
close(1);
close(2);
setsid();
break;
- default: // ïÓÎÏ×ÎÏÊ ÐÒÏÃÅÓÓ
+ default:
for (int i = 0; i < 120 * 5; i++)
{
if (access(startFile.c_str(), F_OK) == 0)
{
- //printf("Fork successfull. Exit.\n");
unlink(startFile.c_str());
exit(0);
}
- Fork and exit
* */
-SETTINGS * settings = NULL;
+SETTINGS_IMPL * settings = NULL;
STORE * dataStore = NULL;
TARIFFS_IMPL * tariffs = NULL;
ADMINS_IMPL * admins = NULL;
}
if (argc == 2)
- settings = new SETTINGS(argv[1]);
+ settings = new SETTINGS_IMPL(argv[1]);
else
- settings = new SETTINGS();
+ settings = new SETTINGS_IMPL();
if (settings->ReadSettings())
{
- //printfd(__FILE__, "ReadSettings error.\n");
STG_LOGGER & WriteServLog = GetStgLogger();
if (settings->GetLogFileName() != "")
modSettings = settings->GetModulesSettings();
-for (unsigned i = 0; i < modSettings.size(); i++)
+for (size_t i = 0; i < modSettings.size(); i++)
{
string modulePath = settings->GetModulesPath();
modulePath += "/mod_";
//printfd(__FILE__, "Error: %s\n", capRunner.GetStrError().c_str());
goto exitLbl;
}
- WriteServLog("Module: \'%s\'. Start successfull. %d", modIter->GetPlugin()->GetVersion().c_str(),
- modIter->GetPlugin()->GetStartPosition());
+ WriteServLog("Module: '%s'. Start successfull.", modIter->GetPlugin()->GetVersion().c_str());
++modIter;
}
SetSignalHandlers();
else
WriteServLog("Queue removed successfully.");
-/*struct sigaction newsa, oldsa;
-sigset_t sigmask;
-sigemptyset(&sigmask);
-sigaddset(&sigmask, SIGCHLD);
-newsa.sa_handler = SIG_IGN;
-newsa.sa_mask = sigmask;
-newsa.sa_flags = 0;
-sigaction(SIGCHLD, &newsa, &oldsa);*/
-
KillExecuters();
StopStgTimer();
WriteServLog("StgTimer: Stop successfull.");
-WriteServLog("Stg stopped successfully.");
-sleep(1);
-WriteServLog("---------------------------------------------");
-
delete traffCnt;
delete users;
delete admins;
delete tariffs;
delete settings;
+WriteServLog("Stg stopped successfully.");
+WriteServLog("---------------------------------------------");
+
return 0;
}
//-----------------------------------------------------------------------------
#include <dlfcn.h>
#include <unistd.h>
-#include <signal.h>
#include "plugin_runner.h"
#include "common.h"
-#include "conffiles.h"
+#include "settings_impl.h"
+#include "admins_impl.h"
+#include "tariffs_impl.h"
+#include "users_impl.h"
+#include "traffcounter.h"
//-----------------------------------------------------------------------------
PLUGIN_RUNNER::PLUGIN_RUNNER(const std::string & pFileName,
const MODULE_SETTINGS & ms,
- ADMINS * a,
- TARIFFS * t,
- USERS * u,
+ ADMINS_IMPL * a,
+ TARIFFS_IMPL * t,
+ USERS_IMPL * u,
TRAFFCOUNTER * tc,
STORE * st,
- const SETTINGS * s)
+ const SETTINGS_IMPL * s)
: pluginFileName(pFileName),
pluginSettingFileName(),
plugin(NULL),
Unload();
}
-isPluginLoaded = 0;
+isPluginLoaded = false;
}
//-----------------------------------------------------------------------------
PLUGIN * PLUGIN_RUNNER::GetPlugin()
{
+if (!isPluginLoaded)
+ {
+ errorStr = "Plugin '" + pluginFileName + "' is not loaded yet!";
+ printfd(__FILE__, "PLUGIN_LOADER::GetPlugin() - %s\n", errorStr.c_str());
+ return NULL;
+ }
+
return plugin;
}
//-----------------------------------------------------------------------------
if (Load())
return -1;
+if (!plugin)
+ {
+ errorStr = "Plugin '" + pluginFileName + "' was not created!";
+ printfd(__FILE__, "PLUGIN_LOADER::Start() - %s\n", errorStr.c_str());
+ return -1;
+ }
+
plugin->SetTariffs(tariffs);
plugin->SetAdmins(admins);
plugin->SetUsers(users);
errorStr = plugin->GetStrError();
return -1;
}
+
return 0;
}
//-----------------------------------------------------------------------------
int PLUGIN_RUNNER::Stop()
{
+if (!isPluginLoaded)
+ {
+ errorStr = "Plugin '" + pluginFileName + "' was not loaded yet!";
+ printfd(__FILE__, "PLUGIN_LOADER::Stop() - %s\n", errorStr.c_str());
+ return -1;
+ }
+
+if (!plugin)
+ {
+ errorStr = "Plugin '" + pluginFileName + "' was not created!";
+ printfd(__FILE__, "PLUGIN_LOADER::Stop() - %s\n", errorStr.c_str());
+ return -1;
+ }
+
plugin->Stop();
-//if (Unload())
-// return -1;
return 0;
}
//-----------------------------------------------------------------------------
int PLUGIN_RUNNER::Reload()
{
+if (!isPluginLoaded)
+ {
+ errorStr = "Plugin '" + pluginFileName + "' was not loaded yet!";
+ printfd(__FILE__, "PLUGIN_LOADER::Reload() - %s\n", errorStr.c_str());
+ return -1;
+ }
+
+if (!plugin)
+ {
+ errorStr = "Plugin '" + pluginFileName + "' was not created!";
+ printfd(__FILE__, "PLUGIN_LOADER::Reload() - %s\n", errorStr.c_str());
+ return -1;
+ }
+
int res = plugin->Reload();
errorStr = plugin->GetStrError();
return res;
bool PLUGIN_RUNNER::IsRunning()
{
if (!isPluginLoaded)
+ {
+ errorStr = "Plugin '" + pluginFileName + "' was not loaded yet!";
+ printfd(__FILE__, "PLUGIN_LOADER::IsRunning() - %s\n", errorStr.c_str());
+ return false;
+ }
+
+if (!plugin)
+ {
+ errorStr = "Plugin '" + pluginFileName + "' was not created!";
+ printfd(__FILE__, "PLUGIN_LOADER::IsRunning() - %s\n", errorStr.c_str());
return false;
+ }
+
return plugin->IsRunning();
}
//-----------------------------------------------------------------------------
int PLUGIN_RUNNER::Load()
{
-if (!pluginFileName.size())
+if (isPluginLoaded)
{
- errorStr = "Plugin loading failed. No plugin";
- printfd(__FILE__, "%s\n", errorStr.c_str());
+ errorStr = "Plugin '" + pluginFileName + "' was already loaded!";
+ printfd(__FILE__, "PLUGIN_LOADER::Load() - %s\n", errorStr.c_str());
+ return -1;
+ }
+
+if (pluginFileName.empty())
+ {
+ errorStr = "Empty plugin file name!";
+ printfd(__FILE__, "PLUGIN_LOADER::Load() - %s\n", errorStr.c_str());
return -1;
}
if (!libHandle)
{
- errorStr = std::string("Plugin loading failed. ") + dlerror();
- printfd(__FILE__, "%s\n", errorStr.c_str());
+ errorStr = "Error loading plugin '"
+ + pluginFileName + "': '" + dlerror() + "'";
+ printfd(__FILE__, "PLUGIN_LOADER::Load() - %s\n", errorStr.c_str());
return -1;
}
+isPluginLoaded = true;
+
PLUGIN * (*GetPlugin)();
GetPlugin = (PLUGIN * (*)())dlsym(libHandle, "GetPlugin");
if (!GetPlugin)
{
errorStr = std::string("GetPlugin() not found. ") + dlerror();
+ printfd(__FILE__, "PLUGIN_LOADER::Load() - %s\n", errorStr.c_str());
return -1;
}
plugin = GetPlugin();
-isPluginLoaded++;
if (!plugin)
{
errorStr = "Plugin was not created!";
- printfd(__FILE__, "%s\n", errorStr.c_str());
+ printfd(__FILE__, "PLUGIN_LOADER::Load() - %s\n", errorStr.c_str());
return -1;
}
plugin->SetSettings(modSettings);
-printfd(__FILE__, "Plugin %s parsesettings\n", plugin->GetVersion().c_str());
if (plugin->ParseSettings())
{
- errorStr = "Plugin \'" + plugin->GetVersion() + "\' error: " + plugin->GetStrError();
+ errorStr = plugin->GetStrError();
+ printfd(__FILE__, "PLUGIN_LOADER::Load() - Failed to parse settings. Plugin reports: '%s'\n", errorStr.c_str());
return -1;
}
{
if (dlclose(libHandle))
{
- errorStr = dlerror();
- printfd(__FILE__, "Error unloading plugin '%s': '%s'", pluginFileName.c_str(), dlerror());
+ errorStr = "Failed to unload plugin '";
+ errorStr += pluginFileName + "': ";
+ errorStr += dlerror();
+ printfd(__FILE__, "PLUGIN_LOADER::Unload() - %s", errorStr.c_str());
return -1;
}
- isPluginLoaded--;
+ plugin = NULL;
+ isPluginLoaded = false;
}
return 0;
}
//-----------------------------------------------------------------------------
-const std::string & PLUGIN_RUNNER::GetStrError() const
-{
-return errorStr;
-}
-//-----------------------------------------------------------------------------
-uint16_t PLUGIN_RUNNER::GetStartPosition() const
-{
-return plugin->GetStartPosition();
-}
-//-----------------------------------------------------------------------------
-uint16_t PLUGIN_RUNNER::GetStopPosition() const
-{
-return plugin->GetStopPosition();
-}
-//-----------------------------------------------------------------------------
#ifndef PLUGIN_RUNNER_H
#define PLUGIN_RUNNER_H
-#include <pthread.h>
-
#include <string>
-#include "plugin.h"
#include "module_settings.h"
-#include "traffcounter.h"
-#include "tariffs.h"
-#include "admins.h"
-#include "users.h"
+#include "plugin.h"
+#include "os_int.h"
+
+class SETTINGS_IMPL;
+class ADMINS_IMPL;
+class TARIFFS_IMPL;
+class USERS_IMPL;
+class TRAFFCOUNTER;
+class STORE;
//-----------------------------------------------------------------------------
class PLUGIN_RUNNER {
public:
PLUGIN_RUNNER(const std::string & pluginFileName,
const MODULE_SETTINGS & ms,
- ADMINS * admins,
- TARIFFS * tariffs,
- USERS * users,
+ ADMINS_IMPL * admins,
+ TARIFFS_IMPL * tariffs,
+ USERS_IMPL * users,
TRAFFCOUNTER * tc,
STORE * store,
- const SETTINGS * s);
+ const SETTINGS_IMPL * s);
PLUGIN_RUNNER(const PLUGIN_RUNNER & rvalue);
~PLUGIN_RUNNER();
int Restart();
bool IsRunning();
- const std::string & GetStrError() const;
+ const std::string & GetStrError() const { return errorStr; }
PLUGIN * GetPlugin();
const std::string & GetFileName() const { return pluginFileName; }
int Load();
int Unload();
- uint16_t GetStartPosition() const;
- uint16_t GetStopPosition() const;
+ uint16_t GetStartPosition() const { return plugin->GetStartPosition(); }
+ uint16_t GetStopPosition() const { return plugin->GetStopPosition(); }
private:
std::string pluginFileName;
std::string pluginSettingFileName;
PLUGIN * plugin;
- int isPluginLoaded;
+ bool isPluginLoaded;
std::string errorStr;
void * libHandle;
bool isRunning;
- ADMINS * admins;
- TARIFFS * tariffs;
- USERS * users;
+ ADMINS_IMPL * admins;
+ TARIFFS_IMPL * tariffs;
+ USERS_IMPL * users;
STORE * store;
TRAFFCOUNTER * traffCnt;
- const SETTINGS * stgSettings;
+ const SETTINGS_IMPL * stgSettings;
MODULE_SETTINGS modSettings;
};
//-----------------------------------------------------------------------------
#include "stg_locker.h"
#include "tariff.h"
#include "user_property.h"
-#include "../../../settings.h"
+#include "settings.h"
extern volatile const time_t stgTime;
#include "rpcconfig.h"
+#include "common.h"
#include "admin.h"
#include "module_settings.h"
-#include "../../../settings.h"
-#include "common.h"
+#include "settings.h"
#include "info_methods.h"
#include "users_methods.h"
#include "version.h"
#include "tariffs.h"
#include "user_property.h"
-#include "../../../settings.h"
+#include "settings.h"
#define UNAME_LEN (256)
//-----------------------------------------------------------------------------
#include "user.h"
#include "stg_locker.h"
#include "user_property.h"
-#include "../../../settings.h"
class PING_CREATOR
{
#include <cerrno>
#include <string>
-#include "settings.h"
+#include "settings_impl.h"
#include "stg_logger.h"
#include "dotconfpp.h"
using namespace std;
//-----------------------------------------------------------------------------
-SETTINGS::SETTINGS()
+SETTINGS_IMPL::SETTINGS_IMPL()
: confDir("/etc/stargazer"),
scriptsDir("/etc/stargazer"),
pidFile("/var/run/stargazer.pid"),
{
}
//-----------------------------------------------------------------------------
-SETTINGS::SETTINGS(const std::string & cd)
+SETTINGS_IMPL::SETTINGS_IMPL(const std::string & cd)
: confDir(cd),
scriptsDir(cd),
monitoring(false),
{
}
//-----------------------------------------------------------------------------
-SETTINGS::SETTINGS(const SETTINGS & rval)
+SETTINGS_IMPL::SETTINGS_IMPL(const SETTINGS_IMPL & rval)
: confDir(rval.confDir),
scriptsDir(rval.scriptsDir),
pidFile(rval.pidFile),
{
}
//-----------------------------------------------------------------------------
-SETTINGS::~SETTINGS()
-{
-}
-//-----------------------------------------------------------------------------
-int SETTINGS::ParseYesNo(const string & value, bool * val)
+int SETTINGS_IMPL::ParseYesNo(const string & value, bool * val)
{
if (0 == strcasecmp(value.c_str(), "yes"))
{
return -1;
}
//-----------------------------------------------------------------------------
-int SETTINGS::ParseInt(const string & value, int * val)
+int SETTINGS_IMPL::ParseInt(const string & value, int * val)
{
if (str2x<int>(value, *val))
{
return 0;
}
//-----------------------------------------------------------------------------
-int SETTINGS::ParseUnsigned(const string & value, unsigned * val)
+int SETTINGS_IMPL::ParseUnsigned(const string & value, unsigned * val)
{
if (str2x<unsigned>(value, *val))
{
return 0;
}
//-----------------------------------------------------------------------------
-int SETTINGS::ParseIntInRange(const string & value, int min, int max, int * val)
+int SETTINGS_IMPL::ParseIntInRange(const string & value, int min, int max, int * val)
{
if (ParseInt(value, val) != 0)
return -1;
return 0;
}
//-----------------------------------------------------------------------------
-int SETTINGS::ParseUnsignedInRange(const string & value, unsigned min, unsigned max, unsigned * val)
+int SETTINGS_IMPL::ParseUnsignedInRange(const string & value, unsigned min, unsigned max, unsigned * val)
{
if (ParseUnsigned(value, val) != 0)
return -1;
return 0;
}
//-----------------------------------------------------------------------------
-int SETTINGS::ParseModuleSettings(const DOTCONFDocumentNode * node, vector<PARAM_VALUE> * params)
+int SETTINGS_IMPL::ParseModuleSettings(const DOTCONFDocumentNode * node, vector<PARAM_VALUE> * params)
{
const DOTCONFDocumentNode * childNode;
PARAM_VALUE pv;
return 0;
}
//-----------------------------------------------------------------------------
-void SETTINGS::ErrorCallback(void * data, const char * buf)
+void SETTINGS_IMPL::ErrorCallback(void * data, const char * buf)
{
printfd(__FILE__, buf);
- SETTINGS * settings = static_cast<SETTINGS *>(data);
+ SETTINGS_IMPL * settings = static_cast<SETTINGS_IMPL *>(data);
settings->logger(buf);
}
//-----------------------------------------------------------------------------
-int SETTINGS::ReadSettings()
+int SETTINGS_IMPL::ReadSettings()
{
const char * requiredOptions[] = {
"ModulesPath",
modulesSettings.clear();
DOTCONFDocument conf(DOTCONFDocument::CASEINSENSITIVE);
-conf.setErrorCallback(SETTINGS::ErrorCallback, this);
+conf.setErrorCallback(SETTINGS_IMPL::ErrorCallback, this);
conf.setRequiredOptionNames(requiredOptions);
string confFile = confDir + "/stargazer.conf";
return 0;
}
//-----------------------------------------------------------------------------
-int SETTINGS::ParseDetailStatWritePeriod(const string & detailStatPeriodStr)
+int SETTINGS_IMPL::ParseDetailStatWritePeriod(const string & detailStatPeriodStr)
{
if (detailStatPeriodStr == "1")
{
*/
-#ifndef SETTINGS_H
-#define SETTINGS_H
+#ifndef SETTINGS_IMPL_H
+#define SETTINGS_IMPL_H
#include <string>
#include <vector>
+#include "settings.h"
#include "common.h"
#include "stg_logger.h"
#include "module_settings.h"
class STG_LOGGER;
class DOTCONFDocumentNode;
//-----------------------------------------------------------------------------
-class SETTINGS {
+class SETTINGS_IMPL : public SETTINGS {
public:
- SETTINGS();
- SETTINGS(const std::string &);
- SETTINGS(const SETTINGS &);
- virtual ~SETTINGS();
+ SETTINGS_IMPL();
+ SETTINGS_IMPL(const std::string &);
+ SETTINGS_IMPL(const SETTINGS_IMPL &);
+ virtual ~SETTINGS_IMPL() {}
int Reload() { return ReadSettings(); }
int ReadSettings();
int GetExecMsgKey() const { return stgExecMsgKey; }
unsigned GetExecutersNum() const { return executersNum; }
- const std::string & GetDirName(int num) const { return dirName[num]; };
+ const std::string & GetDirName(size_t num) const { return dirName[num]; }
const std::string & GetConfDir() const { return confDir; }
const std::string & GetScriptsDir() const { return scriptsDir; }
const std::string & GetRulesFileName() const { return rules; }
const std::string & GetLogFileName() const { return logFile; }
const std::string & GetPIDFileName() const { return pidFile; }
unsigned GetDetailStatWritePeriod() const
- { return detailStatWritePeriod; };
+ { return detailStatWritePeriod; }
unsigned GetStatWritePeriod() const { return statWritePeriod * 60; }
unsigned GetDayFee() const { return dayFee; }
bool GetFullFee() const { return fullFee; }
#include "store_loader.h"
#include "common.h"
#include "store.h"
-#include "settings.h"
+#include "settings_impl.h"
-STORE_LOADER::STORE_LOADER(const SETTINGS & settings)
+STORE_LOADER::STORE_LOADER(const SETTINGS_IMPL & settings)
: isLoaded(false),
handle(NULL),
plugin(NULL),
bool STORE_LOADER::Load()
{
-printfd(__FILE__, "STORE_LOADER::Load()\n");
if (isLoaded)
{
+ errorStr = "Store plugin '" + pluginFileName + "' was alredy loaded!";
+ printfd(__FILE__, "STORE_LOADER::Load() - %s\n", errorStr.c_str());
return false;
}
if (pluginFileName.empty())
{
errorStr = "Empty store plugin filename";
- printfd(__FILE__, "STORE_LOADER::Load - %s\n", errorStr.c_str());
+ printfd(__FILE__, "STORE_LOADER::Load() - %s\n", errorStr.c_str());
return true;
}
{
errorStr = "Error loading plugin '"
+ pluginFileName + "': '" + dlerror() + "'";
- printfd(__FILE__, "STORE_LOADER::Load - %s\n", errorStr.c_str());
+ printfd(__FILE__, "STORE_LOADER::Load() - %s\n", errorStr.c_str());
return true;
}
GetStore = (STORE * (*)())dlsym(handle, "GetStore");
if (!GetStore)
{
- errorStr = "GetStore not found.";
- printfd(__FILE__, "STORE_LOADER::Load - %s\n", errorStr.c_str());
+ errorStr = std::string("GetStore() not found! ") + dlerror();
+ printfd(__FILE__, "STORE_LOADER::Load() - %s\n", errorStr.c_str());
return true;
}
if (!plugin)
{
- errorStr = "NULL store plugin";
- printfd(__FILE__, "STORE_LOADER::Load - %s\n");
+ errorStr = "Plugin was not created!";
+ printfd(__FILE__, "STORE_LOADER::Load() - %s\n");
return true;
}
if (plugin->ParseSettings())
{
errorStr = plugin->GetStrError();
- printfd(__FILE__, "Failed to parse settings. Plugin reports: '%s'\n", errorStr.c_str());
+ printfd(__FILE__, "STORE_LOADER::Load() - Failed to parse settings. Plugin reports: '%s'\n", errorStr.c_str());
return true;
}
printfd(__FILE__, "STORE_LOADER::Unload()\n");
if (!isLoaded)
{
- return false;
+ return true;
}
if (dlclose(handle))
{
- errorStr = "Failed to unload plugin: '";
+ errorStr = "Failed to unload plugin '";
+ errorStr += pluginFileName + "': ";
errorStr += dlerror();
- errorStr += "'";
- printfd(__FILE__, "STORE_LOADER::Unload - %s\n", errorStr.c_str());
+ printfd(__FILE__, "STORE_LOADER::Unload() - %s\n", errorStr.c_str());
return true;
}
#include "noncopyable.h"
class STORE;
-class SETTINGS;
+class SETTINGS_IMPL;
class STORE_LOADER : private NONCOPYABLE {
public:
- STORE_LOADER(const SETTINGS & settings);
+ STORE_LOADER(const SETTINGS_IMPL & settings);
~STORE_LOADER();
bool Load();
#include "user_impl.h"
#include "users.h"
#include "common.h"
-#include "settings.h"
+#include "settings_impl.h"
#include "script_executer.h"
#include "tariff.h"
#include "tariffs.h"
#include "admin.h"
-USER_IMPL::USER_IMPL(const SETTINGS * s,
+USER_IMPL::USER_IMPL(const SETTINGS_IMPL * s,
const STORE * st,
const TARIFFS * t,
const ADMIN * a,
class TARIFFS;
class ADMIN;
class USER_IMPL;
+class SETTINGS_IMPL;
//-----------------------------------------------------------------------------
class USER_ID_GENERATOR {
friend class USER_IMPL;
friend class CHG_CASH_NOTIFIER;
friend class CHG_IP_NOTIFIER;
public:
- USER_IMPL(const SETTINGS * settings,
+ USER_IMPL(const SETTINGS_IMPL * settings,
const STORE * store,
const TARIFFS * tariffs,
const ADMIN * sysAdmin,
TRAFF_STAT traffStat;
std::pair<time_t, TRAFF_STAT> traffStatSaved;
- const SETTINGS * settings;
+ const SETTINGS_IMPL * settings;
std::set<const AUTH *> authorizedBy;
//#define USERS_DEBUG 1
//-----------------------------------------------------------------------------
-USERS_IMPL::USERS_IMPL(SETTINGS * s, STORE * st, TARIFFS * t, const ADMIN * sa)
+USERS_IMPL::USERS_IMPL(SETTINGS_IMPL * s, STORE * st, TARIFFS * t, const ADMIN * sa)
: users(),
usersToDelete(),
userIPNotifiersBefore(),
#include "os_int.h"
#include "store.h"
-#include "settings.h"
+#include "settings_impl.h"
#include "users.h"
#include "user.h"
#include "user_impl.h"
friend class PROPERTY_NOTIFER_IP_AFTER;
public:
- USERS_IMPL(SETTINGS * s, STORE * store, TARIFFS * tariffs, const ADMIN * sysAdmin);
+ USERS_IMPL(SETTINGS_IMPL * s, STORE * store, TARIFFS * tariffs, const ADMIN * sysAdmin);
virtual ~USERS_IMPL();
int FindByName(const std::string & login, USER_PTR * user);
std::map<uint32_t, user_iter> ipIndex;
std::map<std::string, user_iter> loginIndex;
- SETTINGS * settings;
+ SETTINGS_IMPL * settings;
TARIFFS * tariffs;
STORE * store;
const ADMIN * sysAdmin;