diff options
| author | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-26 19:31:37 +0100 |
|---|---|---|
| committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-26 19:31:37 +0100 |
| commit | 80b068028330d7dd55259652e3d0b08383d72286 (patch) | |
| tree | 1a92bf447a3194195ae26820490bc987bcd48d8b /database/sqlite | |
| parent | 5aaa73e32fce6eaf2ee8e47a1242e3ef5191b6c0 (diff) | |
| download | eurephia-80b068028330d7dd55259652e3d0b08383d72286.tar.gz eurephia-80b068028330d7dd55259652e3d0b08383d72286.tar.xz eurephia-80b068028330d7dd55259652e3d0b08383d72286.zip | |
sqlite3 - admin: Added DEBUG statements on all function calls
Diffstat (limited to 'database/sqlite')
| -rw-r--r-- | database/sqlite/administration.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/database/sqlite/administration.c b/database/sqlite/administration.c index 9a6bef2..034e66d 100644 --- a/database/sqlite/administration.c +++ b/database/sqlite/administration.c @@ -71,7 +71,6 @@ void xmlReplaceChars(xmlChar *str, char s, char r) { } - // Authenticate admin user against user database int eDBadminAuth(eurephiaCTX *ctx, const char *req_access, const char *uname, const char *pwd) { dbresult *res = NULL; @@ -80,6 +79,8 @@ int eDBadminAuth(eurephiaCTX *ctx, const char *req_access, const char *uname, co int uid = -1, pwok = 0, access = 0; char interface; + DEBUG(ctx, 20, "Function call: eDBadminAuth(ctx, '%s, '%s', 'xxxxxxxx')", req_access, uname); + assert(ctx != NULL); switch( ctx->context_type ) { @@ -186,6 +187,7 @@ int eDBadminValidateSession(eurephiaCTX *ctx, const char *sesskey, const char *r int valid = 0, access = 0, expire_time = 0; char interface; + DEBUG(ctx, 20, "Function call: eDBadminValidateSession(ctx, '%s, '%s')", sesskey, req_access); assert( (ctx != NULL) && (sesskey != NULL) ); switch( ctx->context_type ) { @@ -272,6 +274,7 @@ int eDBadminRegisterLogin(eurephiaCTX *ctx, eurephiaSESSION *session) { char interface; int uid; + DEBUG(ctx, 20, "Function call: eDBadminRegisterLogin(ctx, {session}'%s')", session->sessionkey); assert((ctx != NULL) && (session != NULL)); switch( ctx->context_type ) { @@ -302,6 +305,7 @@ int eDBadminRegisterLogin(eurephiaCTX *ctx, eurephiaSESSION *session) { int eDBadminLogout(eurephiaCTX *ctx, const char *sessionkey) { dbresult *res = NULL; + DEBUG(ctx, 20, "Function call: eDBadminLogout(ctx, '%s')", sessionkey); assert((ctx != NULL) && (sessionkey != NULL)); // Update session as logged out @@ -332,6 +336,7 @@ int eDBadminConfigSet(eurephiaCTX *ctx, const char *key, const char *val) { dbresult *res = NULL; int found = 0; + DEBUG(ctx, 20, "Function call: eDBadminConfigSet(ctx, '%s', '%s')", key, val); assert((ctx != NULL) && (ctx->dbc != NULL)); res = sqlite_query(ctx, "SELECT count(*) FROM openvpn_config WHERE datakey = '%q'", key); @@ -363,6 +368,7 @@ int eDBadminConfigSet(eurephiaCTX *ctx, const char *key, const char *val) { int eDBadminConfigDelete(eurephiaCTX *ctx, const char *key) { dbresult *res = NULL; + DEBUG(ctx, 20, "Function call: eDBadminConfigDelete(ctx, '%s') ", key); assert((ctx != NULL) && (ctx->dbc != NULL)); res = sqlite_query(ctx, "DELETE FROM openvpn_config WHERE datakey = '%q'", key); @@ -381,6 +387,7 @@ xmlDoc *eDBadminGetUserList(eurephiaCTX *ctx, const char *sortkeys) { char *dbsort = NULL, tmp[34]; int i = 0; + DEBUG(ctx, 20, "Function call: eDBadminGetUserList(ctx, '%s')", sortkeys); assert((ctx != NULL) && (ctx->dbc != 0)); // Convert the input sort keys to the proper database field names @@ -447,6 +454,9 @@ xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, xmlDoc *srch) { xmlDoc *doc = NULL; xmlNode *root_n = NULL, *info_n = NULL, *fieldmap = NULL; + DEBUG(ctx, 20, "Function call: eDBadminGetUserUserInfo(ctx, %i, {xmlDoc})", getInfo); + assert( (ctx != NULL) && (srch != NULL) ); + fieldmap = eurephiaXML_getRoot(ctx, srch, "fieldMapping", 1); uinfo_map = eDBxmlMapping(ctx, tbl_sqlite_users, "u", fieldmap); @@ -708,6 +718,7 @@ int eDBadminAddUser(eurephiaCTX *ctx, xmlDoc *usrinf) { eDBfieldMap *usrinf_map = NULL; int uid = 0; + DEBUG(ctx, 20, "Function call: eDBadminAddUser(ctx, xmlDoc)"); assert( (ctx != NULL) && (usrinf != NULL) ); // Get the add_user node, and then find the fieldMapping node @@ -761,6 +772,7 @@ int eDBadminUpdateUser(eurephiaCTX *ctx, const int uid, xmlDoc *usrinf) { eDBfieldMap *value_map = NULL, *srch_map = NULL; xmlChar *xmluid = 0; + DEBUG(ctx, 20, "Function call: eDBadminUpdateUser(ctx, %i, xmlDoc)", uid); assert( (ctx != NULL) && (usrinf != NULL) ); // Get the update_user node @@ -819,6 +831,7 @@ int eDBadminDeleteUser(eurephiaCTX *ctx, const int uid, xmlDoc *usrinf) { char *uid_str = NULL; int rc = 0; + DEBUG(ctx, 20, "Function call: eDBadminDeleteUser(ctx, %i, xmlDoc)", uid); assert( (ctx != NULL) && (usrinf != NULL) ); // Get the delete_user node @@ -889,6 +902,7 @@ xmlDoc *eDBadminGetCertificateInfo(eurephiaCTX *ctx, xmlDoc *srchxml, const char char *dbsort = NULL; int i; + DEBUG(ctx, 20, "Function call: eDBadminGetCertificateInfo(ctx, xmlDoc, '%s')", sortkeys); assert( (ctx != NULL) && (srchxml != NULL) ); if( sortkeys != NULL ) { @@ -972,6 +986,7 @@ int eDBadminAddCertificate(eurephiaCTX *ctx, xmlDoc *certxml) { dbresult *res = NULL; int certid = 0; + DEBUG(ctx, 20, "Function call: eDBadminAddCertificate(ctx, xmlDoc)"); assert( (ctx != NULL) && (certxml != NULL) ); crtinf_n = eurephiaXML_getRoot(ctx, certxml, "register_certificate", 1); @@ -1034,6 +1049,7 @@ int eDBadminDeleteCertificate(eurephiaCTX *ctx, xmlDoc *certxml) { eDBfieldMap *crtinf_map = NULL; dbresult *res = NULL; + DEBUG(ctx, 20, "Function call: eDBadminDeleteCertificate(ctx, xmlDoc)"); assert( (ctx != NULL) && (certxml != NULL) ); crtinf_n = eurephiaXML_getRoot(ctx, certxml, "delete_certificate", 1); @@ -1072,6 +1088,7 @@ int eDBadminUpdateUserCertLink(eurephiaCTX *ctx, xmlDoc *usrcrt_xml) { char *mode = NULL; int rc = 0; + DEBUG(ctx, 20, "Function call: eDBadminUpdateUserCertLink(ctx, xmlDoc)"); assert( (ctx != NULL) && (usrcrt_xml != NULL) ); usrcrt_n = eurephiaXML_getRoot(ctx, usrcrt_xml, "usercerts_link", 1); |
