#ifndef USER_H
#define USER_H
- #include <ctime>
- #include <string>
-
- #include "os_int.h"
#include "notifer.h"
#include "message.h"
#include "tariff.h"
#include "user_traff.h"
+ #include "os_int.h"
+
+ #include <vector>
+ #include <string>
+
+ #include <ctime>
class USER_PROPERTIES;
class AUTH;
virtual bool GetConnected() const = 0;
virtual time_t GetConnectedModificationTime() const = 0;
+ virtual const std::string & GetLastDisconnectReason() const = 0;
virtual int GetAuthorized() const = 0;
- /*virtual int Authorize(uint32_t ip,
- uint32_t enabledDirs,
- const AUTH * auth) = 0;
- virtual void Unauthorize(const AUTH * auth) = 0;*/
+ virtual time_t GetAuthorizedModificationTime() const = 0;
+
virtual bool IsAuthorizedBy(const AUTH * auth) const = 0;
+ virtual std::vector<std::string> GetAuthorizers() const = 0;
virtual int AddMessage(STG_MSG * msg) = 0;
virtual time_t GetLastWriteStatTime() const = 0;
virtual bool IsInetable() = 0;
- virtual std::string GetEnabledDirs() = 0;
+ virtual std::string GetEnabledDirs() const = 0;
virtual void OnAdd() = 0;
virtual void OnDelete() = 0;
#include <ctime>
#include <string>
#include <set>
+#include <map>
#include <sstream>
#include <iostream>
#include "stg/logger.h"
#include "stg/locker.h"
#include "stg/scriptexecuter.h"
++#include "stg/common.h"
#include "store.h"
#include "admin.h"
#include "noncopyable.h"
extern volatile time_t stgTime;
-
+//-----------------------------------------------------------------------------
+class USER_PROPERTY_BASE {
+public:
+ virtual std::string ToString() const = 0;
+};
//-----------------------------------------------------------------------------
template<typename varT>
-class USER_PROPERTY {
+class USER_PROPERTY : public USER_PROPERTY_BASE {
public:
USER_PROPERTY(varT & val);
virtual ~USER_PROPERTY();
bool isPassword,
bool isStat,
STG_LOGGER & logger,
- const std::string & sd);
+ const std::string & sd,
+ std::map<std::string, USER_PROPERTY_BASE*> & properties);
virtual ~USER_PROPERTY_LOGGED() {}
USER_PROPERTY_LOGGED<varT> * GetPointer() throw() { return this; }
USER_STAT stat;
USER_CONF conf;
+ std::map<std::string, USER_PROPERTY_BASE *> properties;
public:
USER_PROPERTIES(const std::string & sd);
void SetProperties(const USER_PROPERTIES & p) { stat = p.stat; conf = p.conf; }
+ std::string GetPropertyValue(const std::string & name) const;
+ bool Exists(const std::string & name) const;
+
USER_PROPERTY_LOGGED<double> cash;
USER_PROPERTY_LOGGED<DIR_TRAFF> up;
USER_PROPERTY_LOGGED<DIR_TRAFF> down;
bool isPass,
bool isSt,
STG_LOGGER & logger,
- const std::string & sd)
+ const std::string & sd,
+ std::map<std::string, USER_PROPERTY_BASE*> & properties)
: USER_PROPERTY<varT>(val),
stgLogger(logger),
name(n),
scriptsDir(sd)
{
- properties.insert(std::make_pair(name, this));
++properties.insert(std::make_pair(ToLower(name), this));
}
//-------------------------------------------------------------------------
template <typename varT>
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
+inline
+std::string USER_PROPERTIES::GetPropertyValue(const std::string & name) const
+{
+std::map<std::string, USER_PROPERTY_BASE*>::const_iterator it = properties.find(name);
+if (it == properties.end())
+ return "";
+return it->second->ToString();
+}
+//-----------------------------------------------------------------------------
+inline
+bool USER_PROPERTIES::Exists(const std::string & name) const
+{
+return properties.find(name) != properties.end();
+}
+//-------------------------------------------------------------------------
+//-------------------------------------------------------------------------
+//-------------------------------------------------------------------------
template<typename varT>
inline
std::ostream & operator<< (std::ostream & stream, const USER_PROPERTY<varT> & value)
}
//-----------------------------------------------------------------------------
template<typename varT>
+inline
std::string USER_PROPERTY<varT>::ToString() const
{
-std::stringstream stream;
+std::ostringstream stream;
stream << value;
return stream.str();
}
public:
virtual ~USERS() {}
virtual int FindByName(const std::string & login, USER_PTR * user) = 0;
+ virtual int FindByName(const std::string & login, CONST_USER_PTR * user) const = 0;
virtual bool TariffInUse(const std::string & tariffName) const = 0;
virtual bool Authorize(const std::string & login, uint32_t ip,
uint32_t enabledDirs, const AUTH * auth) = 0;
- virtual bool Unauthorize(const std::string & login, const AUTH * auth) = 0;
+ virtual bool Unauthorize(const std::string & login,
+ const AUTH * auth,
+ const std::string & reason = std::string()) = 0;
virtual int ReadUsers() = 0;
virtual size_t Count() const = 0;
virtual int FindByIPIdx(uint32_t ip, USER_PTR * user) const = 0;
virtual bool IsIPInIndex(uint32_t ip) const = 0;
+ virtual bool IsIPInUse(uint32_t ip, const std::string & login, CONST_USER_PTR * user) const = 0;
virtual int OpenSearch() = 0;
virtual int SearchNext(int handle, USER_PTR * u) = 0;
virtual int Start() = 0;
virtual int Stop() = 0;
-
};
#endif
}
}
//-----------------------------------------------------------------------------
- #ifdef LINUX
+ #if defined(LINUX) || defined(DARWIN)
int StartScriptExecuter(char * procName, int msgKey, int * msgID, SETTINGS_IMPL * settings)
#else
int StartScriptExecuter(char *, int msgKey, int * msgID, SETTINGS_IMPL * settings)
case 0:
delete settings;
- #ifdef LINUX
+ #if defined(LINUX) || defined(DARWIN)
Executer(*msgID, executerPid, procName);
#else
Executer(*msgID, executerPid);
default:
if (executersPid.empty()) {
- #ifdef LINUX
+ #if defined(LINUX) || defined(DARWIN)
Executer(*msgID, executerPid, NULL);
#else
Executer(*msgID, executerPid);
WriteServLog("ReadSettings error. %s", settings->GetStrError().c_str());
exit(1);
}
+
#ifndef NO_DAEMON
std::string startFile(settings->GetConfDir() + START_FILE);
#endif
}
break;
default:
- WriteServLog("Ignore signel %d", sig);
+ WriteServLog("Ignore signal %d", sig);
break;
}
if (stop)
authorizedUsers.end(),
UpdateRouter(*this));
+ logger("%s reloaded successfully.", rsSettings.GetMapFileName().c_str());
+ printfd(__FILE__, "REMOTE_SCRIPT::Reload() %s reloaded successfully.\n");
+
return 0;
}
//-----------------------------------------------------------------------------
it != rsSettings.GetUserParams().end();
++it)
{
- std::string parameter(GetUserParam(rsu.user, *it));
+ std::string parameter(rsu.user->GetParamValue(it->c_str()));
if (params.length() + parameter.length() > RS_PARAMS_LEN - 1)
break;
params += parameter + " ";
return std::vector<uint32_t>();
}
//-----------------------------------------------------------------------------
-std::string REMOTE_SCRIPT::GetUserParam(USER_PTR u, const std::string & paramName) const
-{
-std::string value = "";
-if (strcasecmp(paramName.c_str(), "cash") == 0)
- strprintf(&value, "%f", u->GetProperty().cash.Get());
-else
-if (strcasecmp(paramName.c_str(), "freeMb") == 0)
- strprintf(&value, "%f", u->GetProperty().freeMb.Get());
-else
-if (strcasecmp(paramName.c_str(), "passive") == 0)
- strprintf(&value, "%d", u->GetProperty().passive.Get());
-else
-if (strcasecmp(paramName.c_str(), "disabled") == 0)
- strprintf(&value, "%d", u->GetProperty().disabled.Get());
-else
-if (strcasecmp(paramName.c_str(), "alwaysOnline") == 0)
- strprintf(&value, "%d", u->GetProperty().alwaysOnline.Get());
-else
-if (strcasecmp(paramName.c_str(), "tariffName") == 0 ||
- strcasecmp(paramName.c_str(), "tariff") == 0)
- value = "\"" + u->GetProperty().tariffName.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "nextTariff") == 0)
- value = "\"" + u->GetProperty().nextTariff.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "address") == 0)
- value = "\"" + u->GetProperty().address.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "note") == 0)
- value = "\"" + u->GetProperty().note.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "group") == 0)
- value = "\"" + u->GetProperty().group.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "email") == 0)
- value = "\"" + u->GetProperty().email.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "realName") == 0)
- value = "\"" + u->GetProperty().realName.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "credit") == 0)
- strprintf(&value, "%f", u->GetProperty().credit.Get());
-else
-if (strcasecmp(paramName.c_str(), "userdata0") == 0)
- value = "\"" + u->GetProperty().userdata0.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "userdata1") == 0)
- value = "\"" + u->GetProperty().userdata1.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "userdata2") == 0)
- value = "\"" + u->GetProperty().userdata2.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "userdata3") == 0)
- value = "\"" + u->GetProperty().userdata3.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "userdata4") == 0)
- value = "\"" + u->GetProperty().userdata4.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "userdata5") == 0)
- value = "\"" + u->GetProperty().userdata5.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "userdata6") == 0)
- value = "\"" + u->GetProperty().userdata6.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "userdata7") == 0)
- value = "\"" + u->GetProperty().userdata7.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "userdata8") == 0)
- value = "\"" + u->GetProperty().userdata8.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "userdata9") == 0)
- value = "\"" + u->GetProperty().userdata9.Get() + "\"";
-else
-if (strcasecmp(paramName.c_str(), "enabledDirs") == 0)
- value = u->GetEnabledDirs();
-else
- printfd(__FILE__, "Unknown value name: %s\n", paramName.c_str());
-return value;
-}
-//-----------------------------------------------------------------------------
void REMOTE_SCRIPT::SetUserNotifiers(USER_PTR u)
{
ipNotifierList.push_front(RS::IP_NOTIFIER(*this, u));
void REMOTE_SCRIPT::DelRSU(USER_PTR user)
{
STG_LOCKER lock(&mutex, __FILE__, __LINE__);
- const std::map<uint32_t, RS::USER>::iterator it(
+ std::map<uint32_t, RS::USER>::iterator it(authorizedUsers.begin());
+ while (it != authorizedUsers.end())
+ {
+ if (it->second.user == user)
+ {
+ Send(it->second, true);
+ authorizedUsers.erase(it);
+ return;
+ }
+ ++it;
+ }
+ /*const std::map<uint32_t, RS::USER>::iterator it(
authorizedUsers.find(user->GetCurrIP())
);
if (it != authorizedUsers.end())
{
Send(it->second, true);
authorizedUsers.erase(it);
- }
+ }*/
}
//-----------------------------------------------------------------------------
void RS::IP_NOTIFIER::Notify(const uint32_t & /*oldValue*/, const uint32_t & newValue)
#define _GNU_SOURCE
#endif
- #include <pthread.h>
- #include <unistd.h> // access
-
- #include <cassert>
- #include <cstdlib>
- #include <cmath>
+ #include "user_impl.h"
+ #include "settings_impl.h"
+ #include "stg_timer.h"
#include "stg/users.h"
#include "stg/common.h"
#include "stg/tariff.h"
#include "stg/tariffs.h"
#include "stg/admin.h"
- #include "user_impl.h"
- #include "settings_impl.h"
- #include "stg_timer.h"
+
+ #include <algorithm>
+ #include <functional>
+
+ #include <cassert>
+ #include <cstdlib>
+ #include <cmath>
+
+ #include <pthread.h>
+ #include <unistd.h> // access
#ifdef USE_ABSTRACT_SETTINGS
USER_IMPL::USER_IMPL(const SETTINGS * s,
property(s->GetScriptsDir()),
WriteServLog(GetStgLogger()),
lastScanMessages(0),
- login(),
id(0),
__connected(0),
connected(__connected),
- enabledDirs(),
- userIDGenerator(),
__currIP(0),
currIP(__currIP),
lastIPForDisconnect(0),
store(st),
tariffs(t),
tariff(NULL),
- traffStat(),
- traffStatSaved(),
settings(s),
- authorizedBy(),
- messages(),
+ authorizedModificationTime(0),
deleted(false),
lastWriteStat(0),
lastWriteDetailedStat(0),
userdata7(property.userdata7),
userdata8(property.userdata8),
userdata9(property.userdata9),
- sessionUpload(),
- sessionDownload(),
passiveNotifier(this),
tariffNotifier(this),
cashNotifier(this),
- ipNotifier(this),
- mutex(),
- errorStr()
+ ipNotifier(this)
{
password = "*_EMPTY_PASSWORD_*";
tariffName = NO_TARIFF_NAME;
property(s->GetScriptsDir()),
WriteServLog(GetStgLogger()),
lastScanMessages(0),
- login(),
id(0),
__connected(0),
connected(__connected),
- enabledDirs(),
- userIDGenerator(),
__currIP(0),
currIP(__currIP),
lastIPForDisconnect(0),
store(st),
tariffs(t),
tariff(NULL),
- traffStat(),
- traffStatSaved(),
settings(s),
- authorizedBy(),
- messages(),
+ authorizedModificationTime(0),
deleted(false),
lastWriteStat(0),
lastWriteDetailedStat(0),
userdata7(property.userdata7),
userdata8(property.userdata8),
userdata9(property.userdata9),
- sessionUpload(),
- sessionDownload(),
passiveNotifier(this),
disabledNotifier(this),
tariffNotifier(this),
cashNotifier(this),
- ipNotifier(this),
- mutex(),
- errorStr()
+ ipNotifier(this)
{
password = "*_EMPTY_PASSWORD_*";
tariffName = NO_TARIFF_NAME;
id(u.id),
__connected(0),
connected(__connected),
- enabledDirs(),
userIDGenerator(u.userIDGenerator),
__currIP(u.__currIP),
currIP(__currIP),
traffStat(u.traffStat),
traffStatSaved(u.traffStatSaved),
settings(u.settings),
- authorizedBy(),
+ authorizedModificationTime(u.authorizedModificationTime),
messages(u.messages),
deleted(u.deleted),
lastWriteStat(u.lastWriteStat),
disabledNotifier(this),
tariffNotifier(this),
cashNotifier(this),
- ipNotifier(this),
- mutex(),
- errorStr()
+ ipNotifier(this)
{
if (&u == this)
return;
}
}
+ if (authorizedBy.empty())
+ authorizedModificationTime = stgTime;
authorizedBy.insert(auth);
ScanMessage();
return 0;
}
//-----------------------------------------------------------------------------
- void USER_IMPL::Unauthorize(const AUTH * auth)
+ void USER_IMPL::Unauthorize(const AUTH * auth, const std::string & reason)
{
STG_LOCKER lock(&mutex, __FILE__, __LINE__);
/*
if (authorizedBy.empty())
{
+ authorizedModificationTime = stgTime;
+ lastDisconnectReason = reason;
lastIPForDisconnect = currIP;
currIP = 0; // DelUser in traffcounter
return;
return authorizedBy.find(auth) != authorizedBy.end();
}
//-----------------------------------------------------------------------------
+ std::vector<std::string> USER_IMPL::GetAuthorizers() const
+ {
+ std::vector<std::string> list;
+ std::transform(authorizedBy.begin(), authorizedBy.end(), std::back_inserter(list), std::mem_fun(&AUTH::GetVersion));
+ return list;
+ }
+ //-----------------------------------------------------------------------------
void USER_IMPL::Connect(bool fakeConnect)
{
/*
if (!fakeDisconnect)
{
+ lastDisconnectReason = reason;
std::string scriptOnDisonnect = settings->GetScriptsDir() + "/OnDisconnect";
if (access(scriptOnDisonnect.c_str(), X_OK) == 0)
connected = false;
}
- if (store->WriteUserDisconnect(login, up, down, sessionUpload, sessionDownload, cash, freeMb, reason))
+ std::string reasonMessage(reason);
+ if (!lastDisconnectReason.empty())
+ reasonMessage += ": " + lastDisconnectReason;
+
+ if (store->WriteUserDisconnect(login, up, down, sessionUpload, sessionDownload,
+ cash, freeMb, reasonMessage))
{
WriteServLog("Cannot write disconnect for user %s.", login.c_str());
WriteServLog("%s", store->GetStrError().c_str());
return (cash - tariff->GetFee() >= -credit);
}
//-----------------------------------------------------------------------------
-std::string USER_IMPL::GetEnabledDirs()
+std::string USER_IMPL::GetEnabledDirs() const
{
//STG_LOCKER lock(&mutex, __FILE__, __LINE__);
if (passive.ConstData() || tariff == NULL)
return;
+ if (tariff->GetPeriod() != TARIFF::MONTH)
+ return;
+
double fee = tariff->GetFee() / DaysInCurrentMonth();
if (std::fabs(fee) < 1.0e-3)
if (tariff == NULL)
return;
+ if (tariff->GetPeriod() != TARIFF::MONTH)
+ return;
+
double passiveTimePart = 1.0;
if (!settings->GetFullFee())
{
}
}
//-----------------------------------------------------------------------------
+ void USER_IMPL::ProcessDailyFee()
+ {
+ STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+
+ if (passive.ConstData() || tariff == NULL)
+ return;
+
+ if (tariff->GetPeriod() != TARIFF::DAY)
+ return;
+
+ double fee = tariff->GetFee();
+
+ if (fee == 0.0)
+ return;
+
+ double c = cash;
+ switch (settings->GetFeeChargeType())
+ {
+ case 0:
+ property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge");
+ break;
+ case 1:
+ if (c + credit >= 0)
+ property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge");
+ break;
+ case 2:
+ if (c + credit >= fee)
+ property.cash.Set(c - fee, sysAdmin, login, store, "Subscriber fee charge");
+ break;
+ }
+ ResetPassiveTime();
+ }
+ //-----------------------------------------------------------------------------
void USER_IMPL::SetPrepaidTraff()
{
if (tariff != NULL)
//-----------------------------------------------------------------------------
std::string USER_IMPL::GetParamValue(const std::string & name) const
{
-if (name == "freeMb") return property.freeMb.ToString();
-if (name == "passive") return property.passive.ToString();
-if (name == "disabled") return property.disabled.ToString();
-if (name == "alwaysOnline") return property.alwaysOnline.ToString();
-if (name == "tariffName") return property.tariffName;
-if (name == "nextTariff") return property.nextTariff;
-if (name == "address") return property.address;
-if (name == "note") return property.note;
-if (name == "group") return property.group;
-if (name == "email") return property.email;
-if (name == "phone") return property.phone;
-if (name == "realName") return property.realName;
-if (name == "credit") return property.credit.ToString();
-if (name == "userdata0") return property.userdata0;
-if (name == "userdata1") return property.userdata1;
-if (name == "userdata2") return property.userdata2;
-if (name == "userdata3") return property.userdata3;
-if (name == "userdata4") return property.userdata4;
-if (name == "userdata5") return property.userdata5;
-if (name == "userdata6") return property.userdata6;
-if (name == "userdata7") return property.userdata7;
-if (name == "userdata8") return property.userdata8;
-if (name == "userdata9") return property.userdata9;
-if (name == "cash") return property.cash.ToString();
-if (name == "id")
- {
- std::stringstream stream;
- stream << id;
- return stream.str();;
- }
-if (name == "login") return login;
-if (name == "ip") return currIP.ToString();
-return "";
+ if (name == "id")
+ {
+ std::ostringstream stream;
+ stream << id;
+ return stream.str();
+ }
+ if (name == "login") return login;
+ if (name == "currIP") return currIP.ToString();
+ if (name == "enabledDirs") return GetEnabledDirs();
+ if (property.Exists(name))
+ return property.GetPropertyValue(name);
+ else
+ {
+ WriteServLog("User’s parameter '%s' does not exist.", name.c_str());
+ return "";
+ }
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
#ifndef USER_IMPL_H
#define USER_IMPL_H
- #include <ctime>
- #include <list>
- #include <string>
- #include <set>
-
#include "stg/user.h"
- #include "stg/os_int.h"
- #include "stg/const.h"
#include "stg/user_stat.h"
#include "stg/user_conf.h"
#include "stg/user_ips.h"
#include "stg/auth.h"
#include "stg/message.h"
#include "stg/noncopyable.h"
+ #include "stg/os_int.h"
+ #include "stg/const.h"
+
+ #include <list>
+ #include <vector>
+ #include <string>
+ #include <set>
+
+ #include <ctime>
//-----------------------------------------------------------------------------
class TARIFF;
bool GetConnected() const { return connected; }
time_t GetConnectedModificationTime() const { return connected.ModificationTime(); }
+ const std::string & GetLastDisconnectReason() const { return lastDisconnectReason; }
int GetAuthorized() const { return static_cast<int>(authorizedBy.size()); }
+ time_t GetAuthorizedModificationTime() const { return authorizedModificationTime; }
int Authorize(uint32_t ip, uint32_t enabledDirs, const AUTH * auth);
- void Unauthorize(const AUTH * auth);
+ void Unauthorize(const AUTH * auth,
+ const std::string & reason = std::string());
bool IsAuthorizedBy(const AUTH * auth) const;
+ std::vector<std::string> GetAuthorizers() const;
int AddMessage(STG_MSG * msg);
void ProcessDayFee();
void ProcessDayFeeSpread();
void ProcessNewMonth();
+ void ProcessDailyFee();
bool IsInetable();
- std::string GetEnabledDirs();
+ std::string GetEnabledDirs() const;
void OnAdd();
void OnDelete();
USER_PROPERTY<uint32_t> currIP;
uint32_t lastIPForDisconnect; // User's ip after unauth but before disconnect
+ std::string lastDisconnectReason;
time_t pingTime;
#endif
std::set<const AUTH *> authorizedBy;
+ time_t authorizedModificationTime;
std::list<STG_MSG> messages;
USER_PROPERTIES::USER_PROPERTIES(const std::string & sd)
: stat(),
conf(),
- cash (stat.cash, "cash", false, true, GetStgLogger(), sd),
- up (stat.monthUp, "upload", false, true, GetStgLogger(), sd),
- down (stat.monthDown, "download", false, true, GetStgLogger(), sd),
- lastCashAdd (stat.lastCashAdd, "lastCashAdd", false, true, GetStgLogger(), sd),
- passiveTime (stat.passiveTime, "passiveTime", false, true, GetStgLogger(), sd),
- lastCashAddTime (stat.lastCashAddTime, "lastCashAddTime", false, true, GetStgLogger(), sd),
- freeMb (stat.freeMb, "freeMb", false, true, GetStgLogger(), sd),
- lastActivityTime(stat.lastActivityTime, "lastActivityTime", false, true, GetStgLogger(), sd),
+ cash (stat.cash, "cash", false, true, GetStgLogger(), sd, properties),
- up (stat.up, "upload", false, true, GetStgLogger(), sd, properties),
- down (stat.down, "download", false, true, GetStgLogger(), sd, properties),
++ up (stat.monthUp, "upload", false, true, GetStgLogger(), sd, properties),
++ down (stat.monthDown, "download", false, true, GetStgLogger(), sd, properties),
+ lastCashAdd (stat.lastCashAdd, "lastCashAdd", false, true, GetStgLogger(), sd, properties),
+ passiveTime (stat.passiveTime, "passiveTime", false, true, GetStgLogger(), sd, properties),
+ lastCashAddTime (stat.lastCashAddTime, "lastCashAddTime", false, true, GetStgLogger(), sd, properties),
+ freeMb (stat.freeMb, "freeMb", false, true, GetStgLogger(), sd, properties),
+ lastActivityTime(stat.lastActivityTime, "lastActivityTime", false, true, GetStgLogger(), sd, properties),
--
- password (conf.password, "password", true, false, GetStgLogger(), sd),
- passive (conf.passive, "passive", false, false, GetStgLogger(), sd),
- disabled (conf.disabled, "disabled", false, false, GetStgLogger(), sd),
- disabledDetailStat(conf.disabledDetailStat, "DisabledDetailStat", false, false, GetStgLogger(), sd),
- alwaysOnline(conf.alwaysOnline, "alwaysOnline", false, false, GetStgLogger(), sd),
- tariffName (conf.tariffName, "tariff", false, false, GetStgLogger(), sd),
- nextTariff (conf.nextTariff, "new tariff", false, false, GetStgLogger(), sd),
- address (conf.address, "address", false, false, GetStgLogger(), sd),
- note (conf.note, "note", false, false, GetStgLogger(), sd),
- group (conf.group, "group", false, false, GetStgLogger(), sd),
- email (conf.email, "email", false, false, GetStgLogger(), sd),
- phone (conf.phone, "phone", false, false, GetStgLogger(), sd),
- realName (conf.realName, "realName", false, false, GetStgLogger(), sd),
- credit (conf.credit, "credit", false, false, GetStgLogger(), sd),
- creditExpire(conf.creditExpire, "creditExpire", false, false, GetStgLogger(), sd),
- ips (conf.ips, "IP", false, false, GetStgLogger(), sd),
- userdata0 (conf.userdata[0], "userdata0", false, false, GetStgLogger(), sd),
- userdata1 (conf.userdata[1], "userdata1", false, false, GetStgLogger(), sd),
- userdata2 (conf.userdata[2], "userdata2", false, false, GetStgLogger(), sd),
- userdata3 (conf.userdata[3], "userdata3", false, false, GetStgLogger(), sd),
- userdata4 (conf.userdata[4], "userdata4", false, false, GetStgLogger(), sd),
- userdata5 (conf.userdata[5], "userdata5", false, false, GetStgLogger(), sd),
- userdata6 (conf.userdata[6], "userdata6", false, false, GetStgLogger(), sd),
- userdata7 (conf.userdata[7], "userdata7", false, false, GetStgLogger(), sd),
- userdata8 (conf.userdata[8], "userdata8", false, false, GetStgLogger(), sd),
- userdata9 (conf.userdata[9], "userdata9", false, false, GetStgLogger(), sd)
+ password (conf.password, "password", true, false, GetStgLogger(), sd, properties),
+ passive (conf.passive, "passive", false, false, GetStgLogger(), sd, properties),
+ disabled (conf.disabled, "disabled", false, false, GetStgLogger(), sd, properties),
+ disabledDetailStat(conf.disabledDetailStat, "DisabledDetailStat", false, false, GetStgLogger(), sd, properties),
+ alwaysOnline(conf.alwaysOnline, "alwaysOnline", false, false, GetStgLogger(), sd, properties),
+ tariffName (conf.tariffName, "tariff", false, false, GetStgLogger(), sd, properties),
+ nextTariff (conf.nextTariff, "new tariff", false, false, GetStgLogger(), sd, properties),
+ address (conf.address, "address", false, false, GetStgLogger(), sd, properties),
+ note (conf.note, "note", false, false, GetStgLogger(), sd, properties),
+ group (conf.group, "group", false, false, GetStgLogger(), sd, properties),
+ email (conf.email, "email", false, false, GetStgLogger(), sd, properties),
+ phone (conf.phone, "phone", false, false, GetStgLogger(), sd, properties),
+ realName (conf.realName, "realName", false, false, GetStgLogger(), sd, properties),
+ credit (conf.credit, "credit", false, false, GetStgLogger(), sd, properties),
+ creditExpire(conf.creditExpire, "creditExpire", false, false, GetStgLogger(), sd, properties),
+ ips (conf.ips, "ips", false, false, GetStgLogger(), sd, properties),
+ userdata0 (conf.userdata[0], "userdata0", false, false, GetStgLogger(), sd, properties),
+ userdata1 (conf.userdata[1], "userdata1", false, false, GetStgLogger(), sd, properties),
+ userdata2 (conf.userdata[2], "userdata2", false, false, GetStgLogger(), sd, properties),
+ userdata3 (conf.userdata[3], "userdata3", false, false, GetStgLogger(), sd, properties),
+ userdata4 (conf.userdata[4], "userdata4", false, false, GetStgLogger(), sd, properties),
+ userdata5 (conf.userdata[5], "userdata5", false, false, GetStgLogger(), sd, properties),
+ userdata6 (conf.userdata[6], "userdata6", false, false, GetStgLogger(), sd, properties),
+ userdata7 (conf.userdata[7], "userdata7", false, false, GetStgLogger(), sd, properties),
+ userdata8 (conf.userdata[8], "userdata8", false, false, GetStgLogger(), sd, properties),
+ userdata9 (conf.userdata[9], "userdata9", false, false, GetStgLogger(), sd, properties)
{}