Expire account after first login
Stephan Jaeger
stephan.jaeger at ewetel.de
Thu Nov 27 13:42:02 CET 2008
Hi,
i needed to expire an account x seconds after its initial login/first
session start. I came up with this solution using the sqlcounter module.
Maybe this is of interest to others and could go into the docs.
This uses mysql.
sqlcounter expirelogincounter {
counter-name = Expire-After-Initial-Login
check-name = Expire-After
sqlmod-inst = sql
key = User-Name
reset = never
query = "SELECT TIME_TO_SEC(TIMEDIFF(NOW(), acctstarttime)) \
FROM radacct \
WHERE UserName='%{%k}' \
ORDER BY acctstarttime \
LIMIT 1;"
}
Regards
Stephan
--
Stephan Jaeger <stephan.jaeger at ewetel.de>
EWE TEL GmbH
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20081127/85d60ab2/attachment.pgp>
More information about the Freeradius-Devel
mailing list