#include "stg/user_property.h"
#include "stg/user_conf.h"
#include "stg/user_stat.h"
-#include "stg/common.h"
#include <cstdio>
#include <cassert>
int GET_USERS::Start(void *, const char * el, const char ** attr)
{
if (strcasecmp(el, m_tag.c_str()) != 0)
+ {
+ printfd(__FILE__, "Got wrong tag: '%s' instead of '%s'\n", el, m_tag.c_str());
return -1;
+ }
while (attr && *attr && *(attr + 1))
{
assert(h);
if (m_lastUserUpdateTime > 0)
- m_answer = "<" + m_tag + " LastUpdate=\"" + x2str(time(NULL)) + "\">";
+ m_answer = "<Users LastUpdate=\"" + x2str(time(NULL)) + "\">";
else
- m_answer = GetOpenTag();
+ m_answer = "<Users>";
USER_PTR u;
m_users.CloseSearch(h);
- m_answer += GetCloseTag();
+ m_answer += "</Users>";
}
int GET_USER::Start(void *, const char * el, const char ** attr)
CONST_USER_PTR u;
if (m_users.FindByName(m_login, &u))
- m_answer = "<" + m_tag + " result=\"error\" reason=\"User not found.\"/>";
+ m_answer = "<User result=\"error\" reason=\"User not found.\"/>";
else
m_answer = UserToXML(*u, false, m_currAdmin.GetPriv()->userConf || m_currAdmin.GetPriv()->userPasswd);
}
if (!res)
m_users.Del(u->GetLogin(), &m_currAdmin);
+ m_done = true;
+
return 0;
}
return -1;
int CHECK_USER::End(void *, const char *el)
{
if (strcasecmp(el, m_tag.c_str()) == 0)
+ {
+ m_done = true;
return 0;
+ }
return -1;
}