//-----------------------------------------------------------------------------
int TariffsImpl::Chg(const TariffData & td, const Admin * admin)
{
-const auto priv = admin->GetPriv();
+const auto& priv = admin->priv();
-if (!priv->tariffChg)
+if (!priv.tariffChg)
{
- std::string s = admin->GetLogStr() + " Change tariff \'"
+ std::string s = admin->logStr() + " Change tariff \'"
+ td.tariffConf.name + "\'. Access denied.";
strError = "Access denied.";
WriteServLog(s.c_str());
if (ti == tariffs.end())
{
strError = "Tariff \'" + td.tariffConf.name + "\' cannot be changed. Tariff does not exist.";
- WriteServLog("%s %s", admin->GetLogStr().c_str(), strError.c_str());
+ WriteServLog("%s %s", admin->logStr().c_str(), strError.c_str());
return -1;
}
}
WriteServLog("%s Tariff \'%s\' changed.",
- admin->GetLogStr().c_str(), td.tariffConf.name.c_str());
+ admin->logStr().c_str(), td.tariffConf.name.c_str());
return 0;
}
//-----------------------------------------------------------------------------
int TariffsImpl::Del(const std::string & name, const Admin * admin)
{
-const auto priv = admin->GetPriv();
+const auto& priv = admin->priv();
-if (!priv->tariffChg)
+if (!priv.tariffChg)
{
- std::string s = admin->GetLogStr() + " Delete tariff \'"
+ std::string s = admin->logStr() + " Delete tariff \'"
+ name + "\'. Access denied.";
strError = "Access denied.";
WriteServLog(s.c_str());
if (ti == tariffs.end())
{
strError = "Tariff \'" + name + "\' cannot be deleted. Tariff does not exist.";
- WriteServLog("%s %s", admin->GetLogStr().c_str(), strError.c_str());
+ WriteServLog("%s %s", admin->logStr().c_str(), strError.c_str());
return -1;
}
}
WriteServLog("%s Tariff \'%s\' deleted.",
- admin->GetLogStr().c_str(),
+ admin->logStr().c_str(),
name.c_str());
return 0;
}
//-----------------------------------------------------------------------------
int TariffsImpl::Add(const std::string & name, const Admin * admin)
{
-const auto priv = admin->GetPriv();
+const auto& priv = admin->priv();
-if (!priv->tariffChg)
+if (!priv.tariffChg)
{
- std::string s = admin->GetLogStr() + " Add tariff \'"
+ std::string s = admin->logStr() + " Add tariff \'"
+ name + "\'. Access denied.";
strError = "Access denied.";
WriteServLog(s.c_str());
if (ti != tariffs.end())
{
strError = "Tariff \'" + name + "\' cannot be added. Tariff already exist.";
- WriteServLog("%s %s", admin->GetLogStr().c_str(), strError.c_str());
+ WriteServLog("%s %s", admin->logStr().c_str(), strError.c_str());
return -1;
}
}
WriteServLog("%s Tariff \'%s\' added.",
- admin->GetLogStr().c_str(), name.c_str());
+ admin->logStr().c_str(), name.c_str());
return 0;
}