X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/9dc2984179d989f8774ea7ff6d72c81d376b5a2c..ebf7574cf9ee065013517c074fc0d8fd8053fabd:/projects/stargazer/plugins/configuration/sgconfig/parser_admins.cpp diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_admins.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_admins.cpp index 01ae9e81..740d86a7 100644 --- a/projects/stargazer/plugins/configuration/sgconfig/parser_admins.cpp +++ b/projects/stargazer/plugins/configuration/sgconfig/parser_admins.cpp @@ -31,6 +31,11 @@ using STG::PARSER::ADD_ADMIN; using STG::PARSER::DEL_ADMIN; using STG::PARSER::CHG_ADMIN; +const char * GET_ADMINS::tag = "GetAdmins"; +const char * ADD_ADMIN::tag = "AddAdmin"; +const char * DEL_ADMIN::tag = "DelAdmin"; +const char * CHG_ADMIN::tag = "ChgAdmin"; + void GET_ADMINS::CreateAnswer() { const PRIV * priv = m_currAdmin.GetPriv(); @@ -40,9 +45,7 @@ void GET_ADMINS::CreateAnswer() return; } - m_answer.clear(); - - m_answer += GetOpenTag(); + m_answer = ""; ADMIN_CONF ac; int h = m_admins.OpenSearch(); @@ -58,14 +61,14 @@ void GET_ADMINS::CreateAnswer() m_answer += ""; } m_admins.CloseSearch(h); - m_answer += GetCloseTag(); + m_answer += ""; } int DEL_ADMIN::Start(void *, const char * el, const char ** attr) { if (strcasecmp(el, m_tag.c_str()) == 0) { - admin = attr[1]; + m_admin = attr[1]; return 0; } return -1; @@ -73,7 +76,7 @@ int DEL_ADMIN::Start(void *, const char * el, const char ** attr) void DEL_ADMIN::CreateAnswer() { - if (m_admins.Del(admin, &m_currAdmin) == 0) + if (m_admins.Del(m_admin, &m_currAdmin) == 0) m_answer = "<" + m_tag + " Result=\"Ok\"/>"; else m_answer = "<" + m_tag + " Result=\"Error. " + m_admins.GetStrError() + "\"/>"; @@ -83,7 +86,7 @@ int ADD_ADMIN::Start(void *, const char *el, const char **attr) { if (strcasecmp(el, m_tag.c_str()) == 0) { - admin = attr[1]; + m_admin = attr[1]; return 0; } return -1; @@ -91,7 +94,7 @@ int ADD_ADMIN::Start(void *, const char *el, const char **attr) void ADD_ADMIN::CreateAnswer() { - if (m_admins.Add(admin, &m_currAdmin) == 0) + if (m_admins.Add(m_admin, &m_currAdmin) == 0) m_answer = "<" + m_tag + " Result=\"Ok\"/>"; else m_answer = "<" + m_tag + " Result=\"Error. " + m_admins.GetStrError() + "\"/>";