struct USER_CONF
{
USER_CONF()
- : password(),
- passive(0),
+ : passive(0),
disabled(0),
disabledDetailStat(0),
alwaysOnline(0),
- tariffName(),
- address(),
- phone(),
- email(),
- note(),
- realName(),
- corp(),
- service(),
- group(),
credit(0),
- nextTariff(),
userdata(USERDATA_NUM),
- creditExpire(0),
- ips()
+ creditExpire(0)
{}
std::string password;
//-----------------------------------------------------------------------------
struct USER_CONF_RES
{
- USER_CONF_RES()
- : password(),
- passive(),
- disabled(),
- disabledDetailStat(),
- alwaysOnline(),
- tariffName(),
- address(),
- phone(),
- email(),
- note(),
- realName(),
- group(),
- credit(),
- nextTariff(),
- userdata(USERDATA_NUM, RESETABLE<std::string>()),
- creditExpire(),
- ips()
- {
- }
-
USER_CONF_RES & operator=(const USER_CONF & uc)
{
userdata.resize(USERDATA_NUM);
const TARIFFS * t,
const ADMIN * a,
const USERS * u)
- : USER(),
- users(u),
+ : users(u),
property(s->GetScriptsDir()),
WriteServLog(GetStgLogger()),
lastScanMessages(0),
cashNotifier(this),
ipNotifier(this)
{
-password = "*_EMPTY_PASSWORD_*";
-tariffName = NO_TARIFF_NAME;
-ips = StrToIPS("*");
-lastWriteStat = stgTime + random() % settings->GetStatWritePeriod();
-lastWriteDetailedStat = stgTime;
-
-property.tariffName.AddBeforeNotifier(&tariffNotifier);
-property.passive.AddBeforeNotifier(&passiveNotifier);
-property.disabled.AddAfterNotifier(&disabledNotifier);
-property.cash.AddBeforeNotifier(&cashNotifier);
-ips.AddAfterNotifier(&ipNotifier);
-
-pthread_mutexattr_t attr;
-pthread_mutexattr_init(&attr);
-pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-pthread_mutex_init(&mutex, &attr);
+Init();
}
#else
USER_IMPL::USER_IMPL(const SETTINGS_IMPL * s,
const TARIFFS * t,
const ADMIN * a,
const USERS * u)
- : USER(),
- users(u),
+ : users(u),
property(s->GetScriptsDir()),
WriteServLog(GetStgLogger()),
lastScanMessages(0),
cashNotifier(this),
ipNotifier(this)
{
+Init();
+}
+#endif
+//-----------------------------------------------------------------------------
+void USER_IMPL::Init()
+{
password = "*_EMPTY_PASSWORD_*";
tariffName = NO_TARIFF_NAME;
ips = StrToIPS("*");
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&mutex, &attr);
}
-#endif
//-----------------------------------------------------------------------------
USER_IMPL::USER_IMPL(const USER_IMPL & u)
: USER(),