diff options
-rw-r--r-- | database/sqlite/administration.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/database/sqlite/administration.c b/database/sqlite/administration.c index b5f35d8..bd50f6a 100644 --- a/database/sqlite/administration.c +++ b/database/sqlite/administration.c @@ -590,6 +590,7 @@ xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, xmlDoc *srch) { if( (getInfo & USERINFO_lastlog) == USERINFO_lastlog ) { int i = 0; xmlNode *lastl = NULL, *sess = NULL, *tmp1 = NULL, *tmp2 = NULL; + xmlChar *tmp = NULL; qres = sqlite_query(ctx, "SELECT llid, ll.certid, protocol, remotehost, remoteport, macaddr," @@ -638,8 +639,15 @@ xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, xmlDoc *srch) { sqlite_xml_value(tmp1, XML_ATTR, "uicid", qres, i, 16); sqlite_xml_value(tmp1, XML_ATTR, "depth", qres, i, 20); sqlite_xml_value(tmp1, XML_NODE, "digest", qres, i, 21); - sqlite_xml_value(tmp1, XML_NODE, "common_name", qres, i, 22); - sqlite_xml_value(tmp1, XML_NODE, "organisation", qres, i, 23); + + tmp = (xmlChar *)sqlite_get_value(qres, 0, 22); + xmlReplaceChars(tmp, '_', ' '); + xmlNewChild(tmp1, NULL, (xmlChar *) "common_name", tmp); + + tmp = (xmlChar *)sqlite_get_value(qres, 0, 23); + xmlReplaceChars(tmp, '_', ' '); + xmlNewChild(tmp1, NULL, (xmlChar *) "organisation", tmp); + sqlite_xml_value(tmp1, XML_NODE, "email", qres, i, 24); tmp2 = sqlite_xml_value(tmp1, XML_NODE, "access_profile", qres, i, 18); @@ -1404,6 +1412,7 @@ xmlDoc *eDBadminGetLastlog(eurephiaCTX *ctx, xmlDoc *srch, const char *sortkeys) eurephiaXML_CreateDoc(ctx, 1, "lastlog", &doc, &lastl); assert( (doc != NULL) && (lastl != NULL) ); for( i = 0; i < sqlite_get_numtuples(res); i++ ) { + xmlChar *tmp = NULL; sess = xmlNewChild(lastl, NULL, (xmlChar*) "session", NULL); sqlite_xml_value(sess, XML_ATTR, "llid", res, i, 0); xmlNewProp(sess, (xmlChar *) "session_status", @@ -1432,8 +1441,15 @@ xmlDoc *eDBadminGetLastlog(eurephiaCTX *ctx, xmlDoc *srch, const char *sortkeys) sqlite_xml_value(tmp1, XML_ATTR, "uicid", res, i, 16); sqlite_xml_value(tmp1, XML_ATTR, "depth", res, i, 20); sqlite_xml_value(tmp1, XML_NODE, "digest", res, i, 21); - sqlite_xml_value(tmp1, XML_NODE, "common_name", res, i, 22); - sqlite_xml_value(tmp1, XML_NODE, "organisation", res, i, 23); + + tmp = (xmlChar *)sqlite_get_value(res, i, 22); + xmlReplaceChars(tmp, '_', ' '); + xmlNewChild(tmp1, NULL, (xmlChar *) "common_name", tmp); + + tmp = (xmlChar *)sqlite_get_value(res, i, 23); + xmlReplaceChars(tmp, '_', ' '); + xmlNewChild(tmp1, NULL, (xmlChar *) "organisation", tmp); + sqlite_xml_value(tmp1, XML_NODE, "email", res, i, 24); tmp2 = sqlite_xml_value(tmp1, XML_NODE, "access_profile", res, i, 18); |