X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/f8258df50088e0835895c17d8cfee52a6397c51a..0c5f08010e784f0c860c8459141af7da75b2da3c:/projects/stargazer/user_impl.cpp?ds=sidebyside diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index 55a0b197..aea25c78 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.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(); }