summaryrefslogtreecommitdiffstats
path: root/database/sqlite/administration
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2013-05-29 19:51:19 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2013-05-29 19:51:19 +0200
commitefac24b10ee1df25d2e9db35b26d848d8ffc9e6c (patch)
tree519891f4d6f4c5bcf5b275b00827a381a584d46f /database/sqlite/administration
parent522e8fbd46334a4187c73c03bdd051bf2cc7c01b (diff)
downloadeurephia-efac24b10ee1df25d2e9db35b26d848d8ffc9e6c.tar.gz
eurephia-efac24b10ee1df25d2e9db35b26d848d8ffc9e6c.tar.xz
eurephia-efac24b10ee1df25d2e9db35b26d848d8ffc9e6c.zip
eurephiadm/usercerts: Add support for setting up auth-plugins
This enables setting authentication plug-in and the alternative authentication username for user-certificate links. Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'database/sqlite/administration')
-rw-r--r--database/sqlite/administration/usercerts.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/database/sqlite/administration/usercerts.c b/database/sqlite/administration/usercerts.c
index d6f8721..581514a 100644
--- a/database/sqlite/administration/usercerts.c
+++ b/database/sqlite/administration/usercerts.c
@@ -84,11 +84,13 @@ xmlDoc *usercerts_search(eurephiaCTX *ctx, eDBfieldMap *where_m, const char *sor
"SELECT uicid, ucs.uid AS uid, certid, locdt(ucs.registered) AS registered,"
" ucs.accessprofile AS accessprofile, access_descr,"
" username, "
- " common_name, organisation, email, lower(digest), depth "
+ " common_name, organisation, email, lower(digest), depth, "
+ " authplugin, plgname, authusername"
" FROM openvpn_usercerts ucs"
" LEFT JOIN openvpn_certificates USING(certid)"
" LEFT JOIN openvpn_accesses acc ON(ucs.accessprofile = acc.accessprofile)"
- " LEFT JOIN openvpn_users u ON(u.uid = ucs.uid)",
+ " LEFT JOIN openvpn_users u ON(u.uid = ucs.uid)"
+ " LEFT JOIN eurephia_plugins plg ON(ucs.authplugin = plg.plgid)",
NULL, // values (not used for SELECT)
where_m, // fields and values for the WHERE clause
dbsort);
@@ -130,6 +132,14 @@ xmlDoc *usercerts_search(eurephiaCTX *ctx, eDBfieldMap *where_m, const char *sor
tmp_n = sqlite_xml_value(link_n, XML_NODE, "access_profile", res, i, 5);
sqlite_xml_value(tmp_n, XML_ATTR, "accessprofile", res, i, 4);
+
+ // Add optional authentication plug-in info
+ if( atoi_nullsafe(sqlite_get_value(res, i, 12)) > 0 ) {
+ tmp_n = xmlNewChild(link_n, NULL, (xmlChar *) "authplugin", NULL);
+ sqlite_xml_value(tmp_n, XML_ATTR, "authplugid", res, i, 12);
+ sqlite_xml_value(tmp_n, XML_NODE, "description", res, i, 13);
+ sqlite_xml_value(tmp_n, XML_NODE, "auth_username", res, i, 14);
+ }
}
sqlite_free_results(res);