Hello,

I would like to use freeradius to offer a prepaid service where users
can buy a certain number of days and will have unlimited use untill that
period is up.

I created a field in the database with the 'credit expires' date and
have authorize_reply_query() returning a value for Session-Timeout so that
the NAS can inform/disconnect the user.

How can I reject a login and provide a message to the NAS if the current
time is later than the 'credit expires' time in the database? Can
authorize_check_query() result in a message being sent back to the NAS?
Is there another way to do this? I want the NAS to knnow it's a problem
with credit and not simple a wrong password.

My first (ugly) attempt to return Session-Timeout uses the following:

  authorize_reply_query = "SELECT id,UserID,'Session-Timeout',
    paidtill-unix_timestamp() FROM user WHERE Userid = '%{SQL-User-Name}'"

This stops me using any other radreply values. Is there a cleaner way to
get the number of seconds till the 'credit expires' date into Session-Timeout?

thanks,

Mike

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to