summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2012-12-26 00:04:29 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2012-12-26 01:32:54 +0100
commit9225679f4f7c8299067bb5a1c7ec1bfd7641895c (patch)
tree0b376f6b173c3727dacf18b9bab4cb0b61dcec26 /plugin
parentcc1485bbcf5002731b3ee91c795ca42447c54acb (diff)
downloadeurephia-9225679f4f7c8299067bb5a1c7ec1bfd7641895c.tar.gz
eurephia-9225679f4f7c8299067bb5a1c7ec1bfd7641895c.tar.xz
eurephia-9225679f4f7c8299067bb5a1c7ec1bfd7641895c.zip
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 <dazo@users.sourceforge.net>
Diffstat (limited to 'plugin')
-rw-r--r--plugin/eurephia.c9
1 files changed, 5 insertions, 4 deletions
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);