summaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-09-25 13:51:58 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-09-25 13:51:58 +0200
commit63124ebf378c678b377e8bedbfcd676e1e753f04 (patch)
tree87f653accdcd617587a67fdf8b4eacc2eca144af /database
parent311e9a22893da00465a8738f7c1df332ddde9c78 (diff)
downloadeurephia-63124ebf378c678b377e8bedbfcd676e1e753f04.tar.gz
eurephia-63124ebf378c678b377e8bedbfcd676e1e753f04.tar.xz
eurephia-63124ebf378c678b377e8bedbfcd676e1e753f04.zip
Added better error handling in eDBadminUserAccount() view mode (useracc_list())
Diffstat (limited to 'database')
-rw-r--r--database/sqlite/administration/useraccount.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/database/sqlite/administration/useraccount.c b/database/sqlite/administration/useraccount.c
index ac4634c..68b5e8b 100644
--- a/database/sqlite/administration/useraccount.c
+++ b/database/sqlite/administration/useraccount.c
@@ -127,7 +127,7 @@ static xmlDoc *useracc_view(eurephiaCTX *ctx, unsigned int infoType,
if( uinf == NULL ) {
eurephia_log(ctx, LOG_ERROR, 0, "Error querying the database for a user");
- return 0;
+ return eurephiaXML_ResultMsg(ctx, exmlERROR, NULL, "Failed to query the user database");
}
eurephiaXML_CreateDoc(ctx, 1, "UserAccount", &doc, &root_n);
@@ -243,7 +243,8 @@ static xmlDoc *useracc_view(eurephiaCTX *ctx, unsigned int infoType,
if( qres == NULL ) {
eurephia_log(ctx, LOG_ERROR, 0, "Quering the lastlog failed");
xmlFreeDoc(doc);
- return NULL;
+ return eurephiaXML_ResultMsg(ctx, exmlERROR, NULL,
+ "Failed to query the lastlog");
}
lastl = xmlNewChild(user_n, NULL, (xmlChar *) "lastlog", NULL);
@@ -308,7 +309,8 @@ static xmlDoc *useracc_view(eurephiaCTX *ctx, unsigned int infoType,
eurephia_log(ctx, LOG_ERROR, 0, "Quering for login attempts failed");
sqlite_free_results(qres);
xmlFreeDoc(doc);
- return NULL;
+ return eurephiaXML_ResultMsg(ctx, exmlERROR, NULL,
+ "Failed to query the login attempts log");
}
atmpt = xmlNewChild(user_n, NULL, (xmlChar *) "attempts", NULL);
@@ -335,7 +337,8 @@ static xmlDoc *useracc_view(eurephiaCTX *ctx, unsigned int infoType,
eurephia_log(ctx, LOG_ERROR, 0, "Quering blacklist log failed");
sqlite_free_results(qres);
xmlFreeDoc(doc);
- return NULL;
+ return eurephiaXML_ResultMsg(ctx, exmlERROR, NULL,
+ "Failed to query the blacklist log");
}
atmpt = xmlNewChild(user_n, NULL, (xmlChar *) "blacklist", NULL);