sysAdmin(a),
store(st),
tariffs(t),
- tariff(tariffs->GetNoTariff()),
+ tariff(NULL),
cash(property.cash),
up(property.up),
down(property.down),
password = "*_EMPTY_PASSWORD_*";
tariffName = NO_TARIFF_NAME;
connected = 0;
-tariff = tariffs->GetNoTariff();
ips = StrToIPS("*");
deleted = false;
lastWriteStat = stgTime + random() % settings->GetStatWritePeriod();
sysAdmin(a),
store(st),
tariffs(t),
- tariff(tariffs->GetNoTariff()),
+ tariff(NULL),
cash(property.cash),
up(property.up),
down(property.down),
password = "*_EMPTY_PASSWORD_*";
tariffName = NO_TARIFF_NAME;
connected = 0;
-tariff = tariffs->GetNoTariff();
ips = StrToIPS("*");
deleted = false;
lastWriteStat = stgTime + random() % settings->GetStatWritePeriod();
return true;
}
-if (settings->GetShowFeeInCash())
+if (settings->GetShowFeeInCash() || tariff == NULL)
{
return (cash >= -credit);
}
{
STG_LOCKER lock(&mutex, __FILE__, __LINE__);
-if (!connected)
+if (!connected || tariff == NULL)
return;
double cost = 0;
{
STG_LOCKER lock(&mutex, __FILE__, __LINE__);
-if (!connected)
+if (!connected || tariff == NULL)
return;
double cost = 0;
{
STG_LOCKER lock(&mutex, __FILE__, __LINE__);
-if (passive.ConstData())
+if (passive.ConstData() || tariff == NULL)
return;
double fee = tariff->GetFee() / DaysInCurrentMonth();
{
STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+if (tariff == NULL)
+ return;
+
double passiveTimePart = 1.0;
if (!settings->GetFullFee())
{
{
STG_LOCKER lock(&mutex, __FILE__, __LINE__);
-property.freeMb.Set(tariff->GetFree(), sysAdmin, login, store, "Prepaid traffic");
+if (tariff != NULL)
+ property.freeMb.Set(tariff->GetFree(), sysAdmin, login, store, "Prepaid traffic");
}
//-----------------------------------------------------------------------------
int USER_IMPL::AddMessage(STG_MSG * msg)
//-----------------------------------------------------------------------------
void CHG_PASSIVE_NOTIFIER::Notify(const int & oldPassive, const int & newPassive)
{
-if (newPassive && !oldPassive)
+if (newPassive && !oldPassive && user->tariff != NULL)
user->property.cash.Set(user->cash - user->tariff->GetPassiveCost(),
user->sysAdmin,
user->login,