userdata7(property.userdata7),
userdata8(property.userdata8),
userdata9(property.userdata9),
+ sessionUploadModTime(stgTime),
+ sessionDownloadModTime(stgTime),
passiveNotifier(this),
disabledNotifier(this),
tariffNotifier(this),
userdata7(property.userdata7),
userdata8(property.userdata8),
userdata9(property.userdata9),
+ sessionUploadModTime(stgTime),
+ sessionDownloadModTime(stgTime),
passiveNotifier(this),
disabledNotifier(this),
tariffNotifier(this),
{
password = "*_EMPTY_PASSWORD_*";
tariffName = NO_TARIFF_NAME;
+tariff = tariffs->FindByName(tariffName);
ips = StrToIPS("*");
lastWriteStat = stgTime + random() % settings->GetStatWritePeriod();
lastWriteDetailedStat = stgTime;
userdata9(property.userdata9),
sessionUpload(),
sessionDownload(),
+ sessionUploadModTime(stgTime),
+ sessionDownloadModTime(stgTime),
passiveNotifier(this),
disabledNotifier(this),
tariffNotifier(this),
{
const TARIFF * nt = tariffs->FindByName(nextTariff);
if (nt == NULL)
+ {
WriteServLog("Cannot change tariff for user %s. Tariff %s not exist.",
login.c_str(), property.tariffName.Get().c_str());
+ }
else
- property.tariffName.Set(nextTariff, sysAdmin, login, store);
+ {
+ std::string message = tariff->TariffChangeIsAllowed(*nt, stgTime);
+ if (message.empty())
+ {
+ property.tariffName.Set(nextTariff, sysAdmin, login, store);
+ }
+ else
+ {
+ WriteServLog("Tariff change is prohibited for user %s. %s",
+ login.c_str(),
+ message.c_str());
+ }
+ }
ResetNextTariff();
WriteConf();
}