summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-03-29 23:33:23 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-03-29 23:33:23 +0200
commit9922a6f9a6476f680923334789b8857a60f76095 (patch)
tree45b86bc500413cfad6fb7c2f315cb7f2e4ab69b8
parentf7e49e685734be5d2a1110833325bd7ced253b52 (diff)
downloadeurephia-9922a6f9a6476f680923334789b8857a60f76095.tar.gz
eurephia-9922a6f9a6476f680923334789b8857a60f76095.tar.xz
eurephia-9922a6f9a6476f680923334789b8857a60f76095.zip
Added missing xmlReplaceChars(...) on common_name and organisation
-rw-r--r--database/sqlite/administration.c24
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);