From 9225679f4f7c8299067bb5a1c7ec1bfd7641895c Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Wed, 26 Dec 2012 00:04:29 +0100 Subject: Make use of the new eDBregister_login2() call in the eurephia-auth plug-in This will now log VPN client addresses only in the vpnaddr_history table, and lastlog will log the firewall profile the session used. Signed-off-by: David Sommerseth --- plugin/eurephia.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'plugin') diff --git a/plugin/eurephia.c b/plugin/eurephia.c index e41a0dc..620e6e6 100644 --- a/plugin/eurephia.c +++ b/plugin/eurephia.c @@ -145,7 +145,7 @@ eurephiaCTX *eurephiaInit(const char const **argv, const char const **envp) " (David Sommerseth (C) 2008-2012 GPLv2)"); // Load the database driver - if( (error == 0) && eDBlink_init(ctx, dbi, 3) ) { + if( (error == 0) && eDBlink_init(ctx, dbi, 4) ) { // Connect to the database if( !eDBconnect(ctx, dbargc, dbargv) ) { eurephia_log(ctx, LOG_PANIC, 0, "Could not connect to the database"); @@ -503,7 +503,7 @@ int eurephia_connect(eurephiaCTX *ctx, const char **env) { eurephiaSESSION *session = NULL; char *digest, *cname, *uname, *vpnipaddr, *vpnipmask, *remipaddr, *remport, *proto, *tlsid; - int certid = 0, uid = 0, ret = 0; + int certid = 0, uid = 0, accprofile = -1, ret = 0; certinfo *ci = NULL; DEBUG(ctx, 10, "** Function call: eurephia_connect(...)"); @@ -553,9 +553,10 @@ int eurephia_connect(eurephiaCTX *ctx, const char **env) { free_certinfo(ci); // Register the session login - ret = eDBregister_login(ctx, session, certid, uid, proto, remipaddr, remport, vpnipaddr, vpnipmask); + accprofile = eDBget_accessprofile(ctx, uid, certid); + ret = eDBregister_login2(ctx, session, certid, accprofile, uid, proto, remipaddr, remport); eDBfree_session(ctx, session); - eurephia_log(ctx, LOG_INFO, 1, "User '%s' logged in", uname); + eurephia_log(ctx, LOG_INFO, 1, "User '%s' connected", uname); free_nullsafe(ctx, proto); free_nullsafe(ctx, remport); -- cgit