diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-19 15:48:52 +0100 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-19 15:48:52 +0100 |
commit | 77c99fe105b074f5b827a159ed4091ced8912f48 (patch) | |
tree | a93b101ac590648428eb3b7897060cf470477dbf /database | |
parent | e29713fb05ab8cac0fdbd904277d19bc4b2ec215 (diff) | |
download | eurephia-77c99fe105b074f5b827a159ed4091ced8912f48.tar.gz eurephia-77c99fe105b074f5b827a159ed4091ced8912f48.tar.xz eurephia-77c99fe105b074f5b827a159ed4091ced8912f48.zip |
Changed from numeric session status code to text in eDBadminGetUserInfo(...) - lastlog
Diffstat (limited to 'database')
-rw-r--r-- | database/eurephiadb_mapping.c | 11 | ||||
-rw-r--r-- | database/eurephiadb_mapping.h | 1 | ||||
-rw-r--r-- | database/sqlite/administration.c | 3 |
3 files changed, 14 insertions, 1 deletions
diff --git a/database/eurephiadb_mapping.c b/database/eurephiadb_mapping.c index 2103dd1..98a940d 100644 --- a/database/eurephiadb_mapping.c +++ b/database/eurephiadb_mapping.c @@ -44,6 +44,17 @@ const char *TABLE_NAME[] = { "blacklist", NULL}; +// Simple mapping table for session status +const char *SESSION_STATUS[] = { + "UNKNOWN", + "STARTED", + "OPEN", + "CLOSING", + "CLOSED", + "CLEANEDUP", + NULL}; + + // Extra forward declarations to avoid compiler warnings. These functions are inline functions // in eurephia_xml.h, which would then cause multiple declarations of these functions if that // include file gets included here. diff --git a/database/eurephiadb_mapping.h b/database/eurephiadb_mapping.h index f7fbca2..c9db782 100644 --- a/database/eurephiadb_mapping.h +++ b/database/eurephiadb_mapping.h @@ -40,6 +40,7 @@ typedef struct _eDBfieldMap_s { struct _eDBfieldMap_s *next; } eDBfieldMap; +extern const char *SESSION_STATUS[]; #define TABLE_USERS 0x01 #define TABLE_CERTS 0x02 diff --git a/database/sqlite/administration.c b/database/sqlite/administration.c index cb5bac7..c384723 100644 --- a/database/sqlite/administration.c +++ b/database/sqlite/administration.c @@ -571,7 +571,8 @@ xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, xmlDoc *srch) { sess = xmlNewChild(lastl, NULL, (xmlChar*) "session", NULL); sqlite_xml_value(sess, XML_ATTR, "llid", qres, i, 0); - sqlite_xml_value(sess, XML_ATTR, "session_status", qres, i, 8); + xmlNewProp(sess, (xmlChar *) "session_status", + SESSION_STATUS[atoi_nullsafe(sqlite_get_value(qres, i, 8))]); sqlite_xml_value(sess, XML_ATTR, "session_duration", qres, i, 12); sqlite_xml_value(sess, XML_NODE, "sessionkey", qres, i, 9); sqlite_xml_value(sess, XML_NODE, "login", qres, i, 10); |