summaryrefslogtreecommitdiffstats
path: root/database/sqlite/administration/attempts.c
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-09-21 19:04:36 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-09-21 19:04:36 +0200
commit8fc41296cd27af9757f571627f7fd16befc9b8aa (patch)
tree9a2d242654c938ae0b0a327d649f7d7e7f875586 /database/sqlite/administration/attempts.c
parent854f3bb476a3cb7cf370c0f7690d9a376d219609 (diff)
downloadeurephia-8fc41296cd27af9757f571627f7fd16befc9b8aa.tar.gz
eurephia-8fc41296cd27af9757f571627f7fd16befc9b8aa.tar.xz
eurephia-8fc41296cd27af9757f571627f7fd16befc9b8aa.zip
Rewrote eurephiaXML_ResultMsg() to also support adding an xmlNode* with more info
The eurephia result XML document is also changed, and all parsing of the result must be rewritten. To simplify this parsing, a new function is introduced, eurephiaXML_ParseResultMsg().
Diffstat (limited to 'database/sqlite/administration/attempts.c')
-rw-r--r--database/sqlite/administration/attempts.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/database/sqlite/administration/attempts.c b/database/sqlite/administration/attempts.c
index 08c6dc1..e94878a 100644
--- a/database/sqlite/administration/attempts.c
+++ b/database/sqlite/administration/attempts.c
@@ -144,16 +144,16 @@ xmlDoc *attempts_reset(eurephiaCTX *ctx, eDBfieldMap *fmap) {
fields = eDBmappingFieldsPresent(fmap);
if( (fields & (FIELD_UNAME | FIELD_CERTDIGEST | FIELD_REMOTEIP | FIELD_RECID)) == 0 ) {
- return eurephiaXML_ResultMsg(ctx, exmlERROR,
+ return eurephiaXML_ResultMsg(ctx, exmlERROR, NULL,
"Missing username, IP address, certificate digest or atpid");
}
res = sqlite_query_mapped(ctx, SQL_UPDATE, "UPDATE openvpn_attempts", update_vals, fmap, NULL);
if( res == NULL ) {
eurephia_log(ctx, LOG_FATAL, 0, "Could not reset the attempts count");
- ret = eurephiaXML_ResultMsg(ctx, exmlERROR, "Could not reset the attempts count");
+ ret = eurephiaXML_ResultMsg(ctx, exmlERROR, NULL, "Could not reset the attempts count");
} else {
- ret = eurephiaXML_ResultMsg(ctx, exmlRESULT, "Attempts count reset");
+ ret = eurephiaXML_ResultMsg(ctx, exmlRESULT, NULL, "Attempts count reset");
sqlite_free_results(res);
}
return ret;
@@ -175,16 +175,16 @@ xmlDoc *attempts_delete(eurephiaCTX *ctx, eDBfieldMap *fmap) {
fields = eDBmappingFieldsPresent(fmap);
if( (fields & (FIELD_UNAME | FIELD_CERTDIGEST | FIELD_REMOTEIP | FIELD_RECID)) == 0 ) {
- return eurephiaXML_ResultMsg(ctx, exmlERROR,
+ return eurephiaXML_ResultMsg(ctx, exmlERROR, NULL,
"Missing username, IP address, certificate digest or atpid");
}
res = sqlite_query_mapped(ctx, SQL_DELETE, "DELETE FROM openvpn_attempts", NULL, fmap, NULL);
if( res == NULL ) {
eurephia_log(ctx, LOG_FATAL, 0, "Could not remove attempts record");
- ret = eurephiaXML_ResultMsg(ctx, exmlERROR, "Could not delete the attempts record");
+ ret = eurephiaXML_ResultMsg(ctx, exmlERROR, NULL, "Could not delete the attempts record");
} else {
- ret = eurephiaXML_ResultMsg(ctx, exmlRESULT, "Attempts record removed");
+ ret = eurephiaXML_ResultMsg(ctx, exmlRESULT, NULL, "Attempts record removed");
sqlite_free_results(res);
}
return ret;
@@ -234,7 +234,7 @@ xmlDoc *eDBadminAttemptsLog(eurephiaCTX *ctx, xmlDoc *qryxml) {
resxml = attempts_delete(ctx, fmap);
} else {
eurephia_log(ctx, LOG_ERROR, 0, "Attempts - Unknown mode: '%s'", mode);
- resxml = eurephiaXML_ResultMsg(ctx, exmlERROR, "Unknown mode '%s'", mode);
+ resxml = eurephiaXML_ResultMsg(ctx, exmlERROR, NULL, "Unknown mode '%s'", mode);
}
eDBfreeMapping(fmap);
return resxml;