You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sqlcounter_expire_on_login 985B

12345678910111213141516171819202122232425262728293031323334353637
  1. # -*- text -*-
  2. #
  3. # $Id: c950169307009b088b2c31274f496ffe38e8a793 $
  4. #
  5. # Set an account to expire T seconds after first login.
  6. # Requires the Expire-After attribute to be set, in seconds.
  7. # You may need to edit raddb/dictionary to add the Expire-After
  8. # attribute.
  9. #
  10. # This example is for MySQL. Other SQL variants should be similar.
  11. #
  12. # For versions prior to 2.1.11, this module defined the following
  13. # expansion strings:
  14. #
  15. # %k key_name
  16. # %S sqlmod_inst
  17. #
  18. # These SHOULD NOT be used. If these are used in your configuration,
  19. # they should be replaced by the following strings, which will work
  20. # identically to the previous ones:
  21. #
  22. # %k ${key}
  23. # %S ${sqlmod-inst}
  24. #
  25. sqlcounter expire_on_login {
  26. counter-name = Expire-After-Initial-Login
  27. check-name = Expire-After
  28. sqlmod-inst = sql
  29. key = User-Name
  30. reset = never
  31. query = "SELECT TIME_TO_SEC(TIMEDIFF(NOW(), acctstarttime)) \
  32. FROM radacct \
  33. WHERE UserName='%{${key}}' \
  34. ORDER BY acctstarttime \
  35. LIMIT 1;"
  36. }