#include "parser_admins.h"
#include "stg/admins.h"
+#include "stg/admin.h"
+#include "stg/admin_conf.h"
#include <strings.h> // strcasecmp
void GET_ADMINS::CreateAnswer()
{
- const PRIV * priv = m_currAdmin.GetPriv();
+ const auto priv = m_currAdmin.GetPriv();
if (!priv->adminChg)
{
m_answer = "<Error Result=\"Error. Access denied.\"/>";
}
m_answer = "<Admins>";
- ADMIN_CONF ac;
+ AdminConf ac;
int h = m_admins.OpenSearch();
while (m_admins.SearchNext(h, &ac) == 0)
(ac.priv.userAddDel << 8) +
(ac.priv.adminChg << 10) +
(ac.priv.tariffChg << 12);
- m_answer += "<admin login=\"" + ac.login + "\" priv=\"" + x2str(p) + "\"/>";
+ m_answer += "<admin login=\"" + ac.login + "\" priv=\"" + std::to_string(p) + "\"/>";
}
m_admins.CloseSearch(h);
m_answer += "</Admins>";
{
if (!login.empty())
{
- ADMIN * origAdmin = NULL;
+ Admin * origAdmin = NULL;
if (m_admins.Find(login, &origAdmin))
{
return;
}
- ADMIN_CONF conf(origAdmin->GetConf());
+ AdminConf conf(origAdmin->GetConf());
if (!password.empty())
conf.password = password.data();
return;
}
- conf.priv.FromInt(p);
+ conf.priv = Priv(p);
}
if (m_admins.Change(conf, &m_currAdmin) != 0)