summaryrefslogtreecommitdiffstats
path: root/database/sqlite/administration.c
diff options
context:
space:
mode:
Diffstat (limited to 'database/sqlite/administration.c')
-rw-r--r--database/sqlite/administration.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/database/sqlite/administration.c b/database/sqlite/administration.c
index 71b216b..f90c01a 100644
--- a/database/sqlite/administration.c
+++ b/database/sqlite/administration.c
@@ -388,65 +388,6 @@ int eDBadminLogout(eurephiaCTX *ctx, const char *sessionkey) {
/**
- * @copydoc eDBadminGetAdminAccess()
- */
-xmlDoc *eDBadminGetAdminAccess(eurephiaCTX *ctx, xmlDoc *srch_xml) {
- dbresult *res = NULL;
- eDBfieldMap *fmap = NULL;
- int last_uid = -1, i = 0;
-
- xmlDoc *doc = NULL;
- 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_xml != NULL) );
-
- if( (ctx->context_type != ECTX_ADMIN_CONSOLE) && (ctx->context_type != ECTX_ADMIN_WEB) ) {
- eurephia_log(ctx, LOG_CRITICAL, 0,
- "eurephia admin function call attempted with wrong context type");
- return 0;
- }
-
- 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);
-
- // Query the database, find the user defined in the user map
- res = sqlite_query_mapped(ctx, SQL_SELECT,
- "SELECT eac.uid, username, interface, access"
- " FROM eurephia_adminaccess eac"
- " LEFT JOIN openvpn_users USING(uid)",
- NULL, fmap, "uid, interface, access");
- if( res == NULL ) {
- eurephia_log(ctx, LOG_ERROR, 0, "Error querying the database for a access levels");
- return 0;
- }
- eDBfreeMapping(fmap);
-
- eurephiaXML_CreateDoc(ctx, 1, "admin_access_list", &doc, &root_n);
-
- for( i = 0; i < sqlite_get_numtuples(res); i++ ) {
- if( last_uid != atoi_nullsafe(sqlite_get_value(res, i, 0)) ) {
- // Create a new block element when we get a new uid
- rec_n = xmlNewChild(root_n, NULL, (xmlChar *) "user_access", NULL);
- last_uid = atoi_nullsafe(sqlite_get_value(res, i, 0));
-
- tmp_n = sqlite_xml_value(rec_n, XML_NODE, "username", res, i, 1);
- sqlite_xml_value(tmp_n, XML_ATTR, "uid", res, i, 0);
-
- acl_n = xmlNewChild(rec_n, NULL, (xmlChar *) "access_levels", NULL);
- }
-
- tmp_n = sqlite_xml_value(acl_n, XML_NODE, "access", res, i, 3);
- sqlite_xml_value(tmp_n, XML_ATTR, "interface", res, i, 2);
- }
-
- sqlite_free_results(res);
- return doc;
-}
-
-
-/**
* @copydoc eDBadminEditAdminAccess()
*/
int eDBadminEditAdminAccess(eurephiaCTX *ctx, xmlDoc *grant_xml) {