diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2009-09-11 21:47:07 +0200 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2009-09-11 21:47:07 +0200 |
commit | d0e3e448865547fb1be0ecd6c5ce1b27879b5972 (patch) | |
tree | d038915b1ddaa8ddbe7eb4b173b84464147d025a /database/sqlite/administration.c | |
parent | ba41da69fda6fa9a2388e50a00e97992f509145d (diff) | |
download | eurephia-d0e3e448865547fb1be0ecd6c5ce1b27879b5972.tar.gz eurephia-d0e3e448865547fb1be0ecd6c5ce1b27879b5972.tar.xz eurephia-d0e3e448865547fb1be0ecd6c5ce1b27879b5972.zip |
More doxygen comments in the sqlite3 driver
Diffstat (limited to 'database/sqlite/administration.c')
-rw-r--r-- | database/sqlite/administration.c | 316 |
1 files changed, 141 insertions, 175 deletions
diff --git a/database/sqlite/administration.c b/database/sqlite/administration.c index a8725b3..8bd1642 100644 --- a/database/sqlite/administration.c +++ b/database/sqlite/administration.c @@ -19,15 +19,31 @@ * */ +/** + * @file administration.c + * @author David Sommerseth <dazo@users.sourceforge.net> + * @date 2008-12-03 + * + * @brief Functions needed for the administration interface + * + */ + + #include <string.h> #include <unistd.h> #include <assert.h> #include <libxml/tree.h> +/** + * @{ + */ #ifndef DRIVERAPIVERSION # define DRIVERAPIVERSION 2 #endif +/** + * @} + */ #include <sqlite3.h> @@ -47,21 +63,27 @@ #include "sqlite.h" -#define FMAP_USERS -#define FMAP_CERTS -#define FMAP_ADMINACCESS -#define FMAP_LASTLOG -#define FMAP_OVPNATTEMPTS -#define FMAP_OVPNBLACKLIST +#define FMAP_USERS /**< fieldmapping.h: Include declaration of tbl_sqlite_users */ +#define FMAP_CERTS /**< fieldmapping.h: Include declaration of tbl_sqlite_certs */ +#define FMAP_ADMINACCESS /**< fieldmapping.h: Include declaration of tbl_sqlite_eurephiaadmacc */ +#define FMAP_LASTLOG /**< fieldmapping.h: Include declaration of tbl_sqlite_lastlog */ +#define FMAP_OVPNATTEMPTS /**< fieldmapping.h: Include declaration of tbl_sqlite_attempts */ +#define FMAP_OVPNBLACKLIST /**< fieldmapping.h: Include declaration of tbl_sqlite_blacklist */ #include "fieldmapping.h" -#if DRIVERAPIVERSION > 1 +#if (DRIVERAPIVERSION > 1) || defined(DOXYGEN) /* * API Version 2 functions * */ -// local, internal function +/** + * Internal function. String replace in a xmlChar based string + * + * @param str xmlChar input string + * @param s search for this character + * @param r replace the character with this one + */ void xmlReplaceChars(xmlChar *str, char s, char r) { if( str != NULL ) { xmlChar *ptr = str; @@ -76,7 +98,9 @@ void xmlReplaceChars(xmlChar *str, char s, char r) { } -// Authenticate admin user against user database +/** + * @copydoc eDBadminAuth() + */ int eDBadminAuth(eurephiaCTX *ctx, const char *req_access, const char *uname, const char *pwd) { dbresult *res = NULL; char *crpwd = NULL, *dbpwd = NULL; @@ -198,6 +222,10 @@ int eDBadminAuth(eurephiaCTX *ctx, const char *req_access, const char *uname, co return uid; } + +/** + * @copydoc eDBadminValidateSession() + */ int eDBadminValidateSession(eurephiaCTX *ctx, const char *sesskey, const char *req_access) { dbresult *res = NULL; int valid = 0, access = 0, expire_time = 0; @@ -285,6 +313,10 @@ int eDBadminValidateSession(eurephiaCTX *ctx, const char *sesskey, const char *r return (valid && access); } + +/** + * @copydoc eDBadminRegisterLogin() + */ int eDBadminRegisterLogin(eurephiaCTX *ctx, eurephiaSESSION *session) { dbresult *res = NULL; char interface; @@ -318,6 +350,10 @@ int eDBadminRegisterLogin(eurephiaCTX *ctx, eurephiaSESSION *session) { return 1; } + +/** + * @copydoc eDBadminLogout() + */ int eDBadminLogout(eurephiaCTX *ctx, const char *sessionkey) { dbresult *res = NULL; @@ -354,6 +390,10 @@ int eDBadminLogout(eurephiaCTX *ctx, const char *sessionkey) { return 1; } + +/** + * @copydoc eDBadminConfigSet() + */ int eDBadminConfigSet(eurephiaCTX *ctx, const char *key, const char *val) { dbresult *res = NULL; int found = 0; @@ -393,6 +433,10 @@ int eDBadminConfigSet(eurephiaCTX *ctx, const char *key, const char *val) { return 1; } + +/** + * @copydoc eDBadminConfigDelete() + */ int eDBadminConfigDelete(eurephiaCTX *ctx, const char *key) { dbresult *res = NULL; @@ -414,6 +458,10 @@ int eDBadminConfigDelete(eurephiaCTX *ctx, const char *key) { return 1; } + +/** + * @copydoc eDBadminGetUserList() + */ xmlDoc *eDBadminGetUserList(eurephiaCTX *ctx, const char *sortkeys) { xmlDoc *userlist = NULL; xmlNode *root_n = NULL, *user_n = NULL; @@ -464,6 +512,16 @@ xmlDoc *eDBadminGetUserList(eurephiaCTX *ctx, const char *sortkeys) { return userlist; } + +/** + * Internal function. Adds a child node named \<flag\> to an xmlNode containing a flag value + * + * @param node xmlNode pointer where to add the new flag + * @param flagname String containing a name of the flag + * @param flagged Is the flag set or not. The tag will only be added if the flag is set + * + * @return Returns the \c flagged value + */ inline int xml_set_flag(xmlNode *node, char *flagname, int flagged) { if( flagged ) { xmlNewChild(node, NULL, (xmlChar *) "flag", (xmlChar *) flagname); @@ -472,20 +530,10 @@ inline int xml_set_flag(xmlNode *node, char *flagname, int flagged) { } -// This function will search up a user, based on information given in a fieldMapping structure. -// It will return an XML document containing the user information requested, controlled by the -// getInfo flag. These flags are defined in eurephiadb_driver.h -// -// The search XML document format is: -// <eurephia format="1"> -// <fieldMapping table="users"> -// <{search field}>{search value}</{search field}> -// </fieldMapping> -// </eurehpia> -// -// It can be several search field tags to limit the search even more. -// -xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, xmlDoc *srch) { +/** + * @copydoc eDBadminGetUserInfo() + */ +xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int infoType, xmlDoc *srch) { dbresult *uinf = NULL, *qres = NULL; eDBfieldMap *uinfo_map = NULL; int flag = 0, uid = 0; @@ -494,7 +542,7 @@ 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); + DEBUG(ctx, 20, "Function call: eDBadminGetUserUserInfo(ctx, %i, {xmlDoc})", infoType); assert( (ctx != NULL) && (srch != NULL) ); if( (ctx->context_type != ECTX_ADMIN_CONSOLE) && (ctx->context_type != ECTX_ADMIN_WEB) ) { @@ -544,7 +592,7 @@ xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, xmlDoc *srch) { sqlite_xml_value(root_n, XML_NODE, "username", uinf, 0, 0); sqlite_xml_value(root_n, XML_ATTR, "uid", uinf, 0, 4); - if( (getInfo & USERINFO_user) == USERINFO_user ) { + if( (infoType & USERINFO_user) == USERINFO_user ) { info_n = xmlNewChild(root_n, NULL, (xmlChar *) "flags", NULL); // set DEACTIVATED flag, if deactivated field is not NULL @@ -576,7 +624,7 @@ xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, xmlDoc *srch) { sqlite_xml_value(info_n, XML_ATTR, "logincount", uinf, 0, 7); } - if( (getInfo & USERINFO_certs) == USERINFO_certs ) { + if( (infoType & USERINFO_certs) == USERINFO_certs ) { // Extract certificate info qres = sqlite_query(ctx, "SELECT depth, digest, common_name, organisation, email, " @@ -623,7 +671,7 @@ xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, xmlDoc *srch) { } } - if( (getInfo & USERINFO_lastlog) == USERINFO_lastlog ) { + if( (infoType & USERINFO_lastlog) == USERINFO_lastlog ) { int i = 0; xmlNode *lastl = NULL, *sess = NULL, *tmp1 = NULL, *tmp2 = NULL; xmlChar *tmp = NULL; @@ -693,7 +741,7 @@ xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, xmlDoc *srch) { sqlite_free_results(qres); } - if( (getInfo & USERINFO_attempts) == USERINFO_attempts ) { + if( (infoType & USERINFO_attempts) == USERINFO_attempts ) { xmlNode *atmpt = NULL; qres = sqlite_query(ctx, @@ -718,7 +766,7 @@ xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, xmlDoc *srch) { sqlite_free_results(qres); } - if( (getInfo & USERINFO_blacklist) == USERINFO_blacklist ) { + if( (infoType & USERINFO_blacklist) == USERINFO_blacklist ) { xmlNode *atmpt = NULL; qres = sqlite_query(ctx, @@ -752,28 +800,17 @@ xmlDoc *eDBadminGetUserInfo(eurephiaCTX *ctx, int getInfo, xmlDoc *srch) { } -// This function will add a user to the openvpn_users table, based on the -// XML document given. The function returns the UID of the new user. On -// failure, the function returns -1 -// -// XML format: -// <eurephia format="1"> -// <add_user> -// <fieldMapping table="users"> -// <username>{user name}</username> -// <password pwhash="{none|sha512}">{password}</password>" -// </fieldMapping> -// </add_user> -// </eurephia> -// -int eDBadminAddUser(eurephiaCTX *ctx, xmlDoc *usrinf) { +/** + * @copydoc eDBadminAddUser() + */ +int eDBadminAddUser(eurephiaCTX *ctx, xmlDoc *userinfo) { dbresult *res = NULL; xmlNode *usrinf_n = NULL; eDBfieldMap *usrinf_map = NULL; int uid = 0; DEBUG(ctx, 20, "Function call: eDBadminAddUser(ctx, xmlDoc)"); - assert( (ctx != NULL) && (usrinf != NULL) ); + assert( (ctx != NULL) && (userinfo != NULL) ); if( (ctx->context_type != ECTX_ADMIN_CONSOLE) && (ctx->context_type != ECTX_ADMIN_WEB) ) { eurephia_log(ctx, LOG_CRITICAL, 0, @@ -782,7 +819,7 @@ int eDBadminAddUser(eurephiaCTX *ctx, xmlDoc *usrinf) { } // Get the add_user node, and then find the fieldMapping node - usrinf_n = eurephiaXML_getRoot(ctx, usrinf, "add_user", 1); + usrinf_n = eurephiaXML_getRoot(ctx, userinfo, "add_user", 1); if( usrinf_n == NULL ) { eurephia_log(ctx, LOG_ERROR, 0, "Could not find proper add user XML document"); return 0; @@ -812,20 +849,10 @@ int eDBadminAddUser(eurephiaCTX *ctx, xmlDoc *usrinf) { } -// This function will update a user account based on the XML document sent in as a parameter. -// The function will double check that the uid in the argument list and the uid in the XML -// document is coherent. -// -// The format of the input XML is: -// <eurephia format="1"> -// <update_user uid="{uid}"> -// <fieldMapping table="users"> -// <{field name}>{new value}</{field name}> -// </fieldMapping> -// </update_user> -// </eurephia> -// -int eDBadminUpdateUser(eurephiaCTX *ctx, const int uid, xmlDoc *usrinf) { +/** + * @copydoc eDBadminUpdateUser() + */ +int eDBadminUpdateUser(eurephiaCTX *ctx, const int uid, xmlDoc *userinfo) { dbresult *uinf = NULL; xmlDoc *srch_xml = NULL; xmlNode *root_n = NULL, *srch_n = NULL, *values_n = NULL; @@ -833,7 +860,7 @@ int eDBadminUpdateUser(eurephiaCTX *ctx, const int uid, xmlDoc *usrinf) { xmlChar *xmluid = 0; DEBUG(ctx, 20, "Function call: eDBadminUpdateUser(ctx, %i, xmlDoc)", uid); - assert( (ctx != NULL) && (usrinf != NULL) ); + assert( (ctx != NULL) && (userinfo != NULL) ); if( (ctx->context_type != ECTX_ADMIN_CONSOLE) && (ctx->context_type != ECTX_ADMIN_WEB) ) { eurephia_log(ctx, LOG_CRITICAL, 0, @@ -842,7 +869,7 @@ int eDBadminUpdateUser(eurephiaCTX *ctx, const int uid, xmlDoc *usrinf) { } // Get the update_user node - root_n = eurephiaXML_getRoot(ctx, usrinf, "update_user", 1); + root_n = eurephiaXML_getRoot(ctx, userinfo, "update_user", 1); if( root_n == NULL ) { eurephia_log(ctx, LOG_ERROR, 0, "Could not find proper XML element for user update"); return 0; @@ -882,23 +909,17 @@ int eDBadminUpdateUser(eurephiaCTX *ctx, const int uid, xmlDoc *usrinf) { return 1; } -// This function will delete a user to the openvpn_users table, based on the -// XML document given. The uid of the account to be deleted must also be sent -// as a separate parameter, as a security feature -// -// XML format: -// <eurephia format="1"> -// <delete_user uid="{uid}"/> -// </eurephia> -// -int eDBadminDeleteUser(eurephiaCTX *ctx, const int uid, xmlDoc *usrinf) { +/** + * @copydoc eDBadminDeleteUser() + */ +int eDBadminDeleteUser(eurephiaCTX *ctx, const int uid, xmlDoc *userinfo) { dbresult *res = NULL; xmlNode *usrinf_n = NULL; char *uid_str = NULL; int rc = 0; DEBUG(ctx, 20, "Function call: eDBadminDeleteUser(ctx, %i, xmlDoc)", uid); - assert( (ctx != NULL) && (usrinf != NULL) ); + assert( (ctx != NULL) && (userinfo != NULL) ); if( (ctx->context_type != ECTX_ADMIN_CONSOLE) && (ctx->context_type != ECTX_ADMIN_WEB) ) { eurephia_log(ctx, LOG_CRITICAL, 0, @@ -907,7 +928,7 @@ int eDBadminDeleteUser(eurephiaCTX *ctx, const int uid, xmlDoc *usrinf) { } // Get the delete_user node - usrinf_n = eurephiaXML_getRoot(ctx, usrinf, "delete_user", 1); + usrinf_n = eurephiaXML_getRoot(ctx, userinfo, "delete_user", 1); if( usrinf_n == NULL ) { eurephia_log(ctx, LOG_ERROR, 0, "Could not find proper delete user XML document"); return 0; @@ -933,38 +954,21 @@ int eDBadminDeleteUser(eurephiaCTX *ctx, const int uid, xmlDoc *usrinf) { } +/** + * To be removed. No longer in use. + * + * @param ctx + * @param sortkeys + * + * @return + */ xmlDoc *eDBadminGetCertificateList(eurephiaCTX *ctx, const char *sortkeys) { return NULL; } -// This function will search up all matching certificates from openvpn_certificates and return -// the result as an XML document. -// -// Search criterias are set by sending the following XML document: -// -// <eurephia format="1"> -// <certificate_info> -// <fieldMapping table="certificates"> -// <{field name}>{field value}</{field name}> -// ... -// <{field name}>{field value}</{field name}> -// </fieldMapping> -// </certificate_info> -// </eurephia> -// -// The found certificates will be sent in an XML like this: -// -// <eurephia format="1"> -// <certificates certificates={number of found certs}"> -// <certificate certid="{int}" depth="{int}" registered="{date+time}"> -// <digest>{SHA1 digest of cert}</digest> -// <common_name>{(CN) common name of cert}</common_name> -// <organisation>{(O) organisation name of cert}</organisation> -// <email>{(emailAddr) e-mail address found in cert}</email> -// </certificate> -// </certificates> -// </eurephia> -// +/** + * @copydoc eDBadminGetCertificateInfo() + */ xmlDoc *eDBadminGetCertificateInfo(eurephiaCTX *ctx, xmlDoc *srchxml, const char *sortkeys) { xmlDoc *certlist = NULL; xmlNode *srch_n = NULL, *cert_n = NULL, *tmp_n = NULL; @@ -1049,31 +1053,17 @@ xmlDoc *eDBadminGetCertificateInfo(eurephiaCTX *ctx, xmlDoc *srchxml, const char } -// This functions register a certificate into openvpn_certificates, based on the -// following XML document: -// -// <eurephia format="1"> -// <register_certificate> -// <fieldMapping table="certificates"> -// <depth>{cert.depth}</depth> -// <digest>{SHA1 digest}</digest> -// <common_name>{common_name}</common_name> -// <organisation>{org.}</organisation> -// <email>{email addr}</email> -// </fieldMapping> -// </register_certificate> -// </eurephia> -// -// The function returns certid of the newly registered certificate on success, -// and -1 on failure -int eDBadminAddCertificate(eurephiaCTX *ctx, xmlDoc *certxml) { +/** + * @copydoc eDBadminAddCertificate() + */ +int eDBadminAddCertificate(eurephiaCTX *ctx, xmlDoc *certinfo_xml) { xmlNode *crtinf_n = NULL; eDBfieldMap *crtinf_map = NULL, *ptr = NULL; dbresult *res = NULL; int certid = 0; DEBUG(ctx, 20, "Function call: eDBadminAddCertificate(ctx, xmlDoc)"); - assert( (ctx != NULL) && (certxml != NULL) ); + assert( (ctx != NULL) && (certinfo_xml != NULL) ); if( (ctx->context_type != ECTX_ADMIN_CONSOLE) && (ctx->context_type != ECTX_ADMIN_WEB) ) { eurephia_log(ctx, LOG_CRITICAL, 0, @@ -1081,7 +1071,7 @@ int eDBadminAddCertificate(eurephiaCTX *ctx, xmlDoc *certxml) { return 0; } - crtinf_n = eurephiaXML_getRoot(ctx, certxml, "register_certificate", 1); + crtinf_n = eurephiaXML_getRoot(ctx, certinfo_xml, "register_certificate", 1); if( crtinf_n == NULL ) { eurephia_log(ctx, LOG_ERROR, 0, "Could not find a valid XML for registering certificate"); return 0; @@ -1119,30 +1109,17 @@ int eDBadminAddCertificate(eurephiaCTX *ctx, xmlDoc *certxml) { } -// This functions deletes certificates from openvpn_certificates, based on the -// following XML document: -// -// <eurephia format="1"> -// <delete_certificate> -// <fieldMapping table="certificates"> -// <digest>{SHA1 digest}</digest> -// <common_name>{common_name}</common_name> -// <organisation>{org.}</organisation> -// <email>{email addr}</email> -// </fieldMapping> -// </register_certificate> -// </eurephia> -// -// Not all fieldMapping fields are needed, as you can do bulk removal certificates -// -int eDBadminDeleteCertificate(eurephiaCTX *ctx, xmlDoc *certxml) { +/** + * @copydoc eDBadminDeleteCertificate() + */ +int eDBadminDeleteCertificate(eurephiaCTX *ctx, xmlDoc *certinfo_xml) { int rc = 0; xmlNode *crtinf_n = NULL; eDBfieldMap *crtinf_map = NULL, *ptr = NULL; dbresult *res = NULL; DEBUG(ctx, 20, "Function call: eDBadminDeleteCertificate(ctx, xmlDoc)"); - assert( (ctx != NULL) && (certxml != NULL) ); + assert( (ctx != NULL) && (certinfo_xml != NULL) ); if( (ctx->context_type != ECTX_ADMIN_CONSOLE) && (ctx->context_type != ECTX_ADMIN_WEB) ) { eurephia_log(ctx, LOG_CRITICAL, 0, @@ -1150,7 +1127,7 @@ int eDBadminDeleteCertificate(eurephiaCTX *ctx, xmlDoc *certxml) { return 0; } - crtinf_n = eurephiaXML_getRoot(ctx, certxml, "delete_certificate", 1); + crtinf_n = eurephiaXML_getRoot(ctx, certinfo_xml, "delete_certificate", 1); if( crtinf_n == NULL ) { eurephia_log(ctx, LOG_ERROR, 0, "Could not find a valid XML for the delete certificate request"); return 0; @@ -1188,20 +1165,10 @@ int eDBadminDeleteCertificate(eurephiaCTX *ctx, xmlDoc *certxml) { } - - -// The search XML document format is: -// <eurephia format="1"> -// <admin_access> -// <fieldMapping table="eurephia_adminaccess"> -// <{search field}>{search value}</{search field}> -// </fieldMapping> -// </admin_access> -// </eurehpia> -// -// It can be several search field tags to limit the search even more. -// -xmlDoc *eDBadminGetAdminAccess(eurephiaCTX *ctx, xmlDoc *srch) { +/** + * @copydoc eDBadminGetAdminAccess() + */ +xmlDoc *eDBadminGetAdminAccess(eurephiaCTX *ctx, xmlDoc *srch_xml) { dbresult *res = NULL; eDBfieldMap *fmap = NULL; int last_uid = -1, i = 0; @@ -1210,7 +1177,7 @@ xmlDoc *eDBadminGetAdminAccess(eurephiaCTX *ctx, xmlDoc *srch) { xmlNode *root_n = NULL, *fieldmap_n = NULL, *rec_n = NULL, *acl_n = NULL, *tmp_n; DEBUG(ctx, 20, "Function call: eDBadminGetAdminAccess(ctx, {xmlDoc})"); - assert( (ctx != NULL) && (srch != NULL) ); + assert( (ctx != NULL) && (srch_xml != NULL) ); if( (ctx->context_type != ECTX_ADMIN_CONSOLE) && (ctx->context_type != ECTX_ADMIN_WEB) ) { eurephia_log(ctx, LOG_CRITICAL, 0, @@ -1218,7 +1185,7 @@ xmlDoc *eDBadminGetAdminAccess(eurephiaCTX *ctx, xmlDoc *srch) { return 0; } - tmp_n = eurephiaXML_getRoot(ctx, srch, "admin_access", 1); + tmp_n = eurephiaXML_getRoot(ctx, srch_xml, "admin_access", 1); fieldmap_n = xmlFindNode(tmp_n, "fieldMapping"); fmap = eDBxmlMapping(ctx, tbl_sqlite_eurephiaadmacc, "eac", fieldmap_n); @@ -1257,21 +1224,9 @@ xmlDoc *eDBadminGetAdminAccess(eurephiaCTX *ctx, xmlDoc *srch) { } -// This functions updates (INSERT/DELETE) records in the eurephia_adminaccess table -// based on information from the following XML document: -// -// <eurephia format="1"> -// <edit_admin_access mode="{grant|revoke}"> -// <fieldMapping table="eurephia_adminaccess"> -// <uid>{user id}</uid> -// <interface>{C|W}</uid> -// <accesslevel>{access level string}</accesslevel> -// </fieldMapping> -// </edit_admin_access> -// </eurephia> -// -// To grant access, all fields are needed. For bulk revokes, some fields can be skipped -// +/** + * @copydoc eDBadminEditAdminAccess() + */ int eDBadminEditAdminAccess(eurephiaCTX *ctx, xmlDoc *grant_xml) { dbresult *res = NULL; xmlNode *grant_n = NULL, *fmap_n = NULL; @@ -1330,7 +1285,10 @@ int eDBadminEditAdminAccess(eurephiaCTX *ctx, xmlDoc *grant_xml) { } -xmlDoc *eDBadminGetLastlog(eurephiaCTX *ctx, xmlDoc *srch, const char *sortkeys) +/** + * @copydoc eDBadminGetLastlog() + */ +xmlDoc *eDBadminGetLastlog(eurephiaCTX *ctx, xmlDoc *srch_xml, const char *sortkeys) { dbresult *res = NULL; eDBfieldMap *fmap = NULL, *fptr = NULL; @@ -1340,7 +1298,7 @@ xmlDoc *eDBadminGetLastlog(eurephiaCTX *ctx, xmlDoc *srch, const char *sortkeys) xmlNode *fieldmap_n = NULL, *lastl = NULL, *sess = NULL, *tmp1 = NULL, *tmp2 = NULL; DEBUG(ctx, 20, "Function call: eDBadminGetLastLog(ctx, {xmlDoc})"); - assert( (ctx != NULL) && (srch != NULL) ); + assert( (ctx != NULL) && (srch_xml != NULL) ); if( (ctx->context_type != ECTX_ADMIN_CONSOLE) && (ctx->context_type != ECTX_ADMIN_WEB) ) { eurephia_log(ctx, LOG_CRITICAL, 0, @@ -1348,7 +1306,7 @@ xmlDoc *eDBadminGetLastlog(eurephiaCTX *ctx, xmlDoc *srch, const char *sortkeys) return NULL; } - tmp1 = eurephiaXML_getRoot(ctx, srch, "lastlog_query", 1); + tmp1 = eurephiaXML_getRoot(ctx, srch_xml, "lastlog_query", 1); fieldmap_n = xmlFindNode(tmp1, "fieldMapping"); fmap = eDBxmlMapping(ctx, tbl_sqlite_lastlog, "ll", fieldmap_n); @@ -1448,6 +1406,10 @@ xmlDoc *attempts_list(eurephiaCTX *ctx, eDBfieldMap *fmap); xmlDoc *attempts_reset(eurephiaCTX *ctx, eDBfieldMap *fmap); xmlDoc *attempts_delete(eurephiaCTX *ctx, eDBfieldMap *fmap); + +/** + * @copydoc eDBadminAttemptsLog() + */ xmlDoc *eDBadminAttemptsLog(eurephiaCTX *ctx, xmlDoc *qryxml) { eDBfieldMap *fmap = NULL; char *mode = NULL; @@ -1511,6 +1473,10 @@ xmlDoc *blacklist_list(eurephiaCTX *ctx, eDBfieldMap *fmap); xmlDoc *blacklist_add(eurephiaCTX *ctx, eDBfieldMap *fmap); xmlDoc *blacklist_delete(eurephiaCTX *ctx, eDBfieldMap *fmap); + +/** + * @copydoc eDBadminBlacklist() + */ xmlDoc *eDBadminBlacklist(eurephiaCTX *ctx, xmlDoc *qryxml) { eDBfieldMap *fmap = NULL; char *mode = NULL; |