git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed unused constants.
[stg.git]
/
projects
/
stargazer
/
plugins
/
configuration
/
sgconfig
/
parser_users.cpp
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/parser_users.cpp
b/projects/stargazer/plugins/configuration/sgconfig/parser_users.cpp
index c9a2e3d38fac40a5eb3aaf38250073a5eafd7d22..67e2c6996a07dd840cec07164d002945241a1f49 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/parser_users.cpp
+++ b/
projects/stargazer/plugins/configuration/sgconfig/parser_users.cpp
@@
-26,7
+26,6
@@
#include "stg/user_property.h"
#include "stg/user_conf.h"
#include "stg/user_stat.h"
#include "stg/user_property.h"
#include "stg/user_conf.h"
#include "stg/user_stat.h"
-#include "stg/common.h"
#include <cstdio>
#include <cassert>
#include <cstdio>
#include <cassert>
@@
-177,7
+176,10
@@
std::string UserToXML(const USER & user, bool loginInStart, bool showPass, time_
int GET_USERS::Start(void *, const char * el, const char ** attr)
{
if (strcasecmp(el, m_tag.c_str()) != 0)
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;
return -1;
+ }
while (attr && *attr && *(attr + 1))
{
while (attr && *attr && *(attr + 1))
{
@@
-195,9
+197,9
@@
void GET_USERS::CreateAnswer()
assert(h);
if (m_lastUserUpdateTime > 0)
assert(h);
if (m_lastUserUpdateTime > 0)
- m_answer = "<
" + m_tag + "
LastUpdate=\"" + x2str(time(NULL)) + "\">";
+ m_answer = "<
Users
LastUpdate=\"" + x2str(time(NULL)) + "\">";
else
else
- m_answer =
GetOpenTag()
;
+ m_answer =
"<Users>"
;
USER_PTR u;
USER_PTR u;
@@
-206,7
+208,7
@@
void GET_USERS::CreateAnswer()
m_users.CloseSearch(h);
m_users.CloseSearch(h);
- m_answer +=
GetCloseTag()
;
+ m_answer +=
"</Users>"
;
}
int GET_USER::Start(void *, const char * el, const char ** attr)
}
int GET_USER::Start(void *, const char * el, const char ** attr)
@@
-226,7
+228,7
@@
void GET_USER::CreateAnswer()
CONST_USER_PTR u;
if (m_users.FindByName(m_login, &u))
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);
}
else
m_answer = UserToXML(*u, false, m_currAdmin.GetPriv()->userConf || m_currAdmin.GetPriv()->userPasswd);
}
@@
-680,6
+682,8
@@
int DEL_USER::End(void *, const char *el)
if (!res)
m_users.Del(u->GetLogin(), &m_currAdmin);
if (!res)
m_users.Del(u->GetLogin(), &m_currAdmin);
+ m_done = true;
+
return 0;
}
return -1;
return 0;
}
return -1;
@@
-729,7
+733,10
@@
int CHECK_USER::Start(void *, const char *el, const char **attr)
int CHECK_USER::End(void *, const char *el)
{
if (strcasecmp(el, m_tag.c_str()) == 0)
int CHECK_USER::End(void *, const char *el)
{
if (strcasecmp(el, m_tag.c_str()) == 0)
+ {
+ m_done = true;
return 0;
return 0;
+ }
return -1;
}
return -1;
}