X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/72635da73fc450b040d72fbeca4becd73c99008d..6be0c419e91a659c10478055156b70f40750bbfd:/projects/stargazer/user_impl.cpp diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index 5d505307..8c38d909 100644 --- a/projects/stargazer/user_impl.cpp +++ b/projects/stargazer/user_impl.cpp @@ -1178,10 +1178,24 @@ if (nextTariff.ConstData() != "") { 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); + if (message == "") + { + 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(); }