diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-11 00:05:29 +0100 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2008-12-11 00:05:29 +0100 |
commit | 94b035d4a269bf79374d8b43281cb516e5218a6c (patch) | |
tree | 1e9d1f6cf3b29f0d0210eec33d496098edbfe712 /eurephiadm | |
parent | c71f6dab57b454f19f3566b6ed544ff10342ec16 (diff) | |
download | eurephia-94b035d4a269bf79374d8b43281cb516e5218a6c.tar.gz eurephia-94b035d4a269bf79374d8b43281cb516e5218a6c.tar.xz eurephia-94b035d4a269bf79374d8b43281cb516e5218a6c.zip |
Added functions for processing eurephiaACCESSINFO/eurephiaACCESSLIST
Implemented saving VPN access profile to the eurephiaCERTINFO struct and
filling the eurephiaACCESSINFO with the proper information needed in the
eDBadminGetUserInfo(...) function.
The special thing about eurephiaACCESSINFO, is that it will not register
duplicate records. And when the eurephiaCERTINFO is free'd, the
eurephiaACCESSLIST will automatically be free'd as well.
Diffstat (limited to 'eurephiadm')
-rw-r--r-- | eurephiadm/CMakeLists.txt | 5 | ||||
-rw-r--r-- | eurephiadm/commands/users.c | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/eurephiadm/CMakeLists.txt b/eurephiadm/CMakeLists.txt index a920ac6..be23c15 100644 --- a/eurephiadm/CMakeLists.txt +++ b/eurephiadm/CMakeLists.txt @@ -20,6 +20,11 @@ SET(efw_ipt_SRC ../database/eurephiadb.c ) +IF(FIREWALL) + ADD_DEFINITIONS(-DFIREWALL) + +ENDIF(FIREWALL) + INCLUDE_DIRECTORIES(../common ../database) ADD_EXECUTABLE(eurephiadm ${efw_ipt_SRC}) TARGET_LINK_LIBRARIES(eurephiadm dl crypto) diff --git a/eurephiadm/commands/users.c b/eurephiadm/commands/users.c index 7f92061..aaeb666 100644 --- a/eurephiadm/commands/users.c +++ b/eurephiadm/commands/users.c @@ -276,17 +276,29 @@ int show_user(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, int field_print_int("Associated certificates", user->certlist->num_certs); printf(" %3s (D) %-35.35s %33.33s\n %-49.49s %19.19s\n", "ID", "Common name", "Organisation", "e-mail", "Registered"); - printf("---------------------------------------------------------------------" +#ifdef FIREWALL + printf(" %-44.44s %24.24s\n", "Firewall access profile", "FW Destination"); +#endif + printf(" --------------------------------------------------------------------" "----------\n"); for( crt = user->certlist->certs; crt != NULL; crt = crt->next) { printf(" %3i (%1i) %-35.35s %33.33s\n %-49.49s %19.19s\n", crt->certid, crt->depth, crt->common_name, crt->organisation, crt->email, crt->registered); +#ifdef FIREWALL + printf(" %-44.44s %24.24s\n", + ((crt->access != NULL) && (crt->access->access_descr != NULL) + ? crt->access->access_descr : "(No firewall profile setup)"), + ((crt->access != NULL) && (crt->access->fwprofile != NULL) + ? crt->access->fwprofile : "-") + + ); +#endif if( crt->next != NULL ) { printf("\n"); } } - printf("---------------------------------------------------------------------" + printf(" --------------------------------------------------------------------" "----------\n"); } else { // If we wanted to show associated certs, and didn't find any - inform about it |