Comparison

mod_lastlog/mod_lastlog.lua @ 615:4134d0e25242

mod_lastlog: New module to record last time a user authenticated
author Kim Alvefur <zash@zash.se>
date Fri, 24 Feb 2012 15:28:17 +0100
child 616:884ae37d76bf
comparison
equal deleted inserted replaced
614:40ab83736f6e 615:4134d0e25242
1 local datamanager = require "util.datamanager";
2 local time = os.time;
3
4 module:hook("authentication-success", function(event)
5 local session = event.session;
6 if session.username then
7 datamanager.store(session.username, session.host, "lastlog", {
8 timestamp = time(),
9 });
10 end
11 end);