+ const auto currentTariff = u->GetTariff();
+ std::string message = currentTariff->TariffChangeIsAllowed(*newTariff, stgTime);
+ if (message.empty())
+ {
+ if (u->GetProperties().tariffName.Set(tariff, *admin, login, *store, comment))
+ {
+ u->ResetNextTariff();
+ u->WriteConf();
+ *retvalPtr = xmlrpc_c::value_boolean(true);
+ return;
+ }
+ }
+ else
+ {
+ STG::PluginLogger::get("conf_rpc")("Tariff change is prohibited for user %s. %s", u->GetLogin().c_str(), message.c_str());
+ }