--snip--
> > > a) If you use a Database backend for FreeRadius which one do you use?
> > >
> Postgres
> > > b) If you do not use a DB backend for FreeRadius, but do have a DB on your
> > > server or in your rack, what DB is it?
-- snip--
> > d) If you do use a DB backend for FR do you use the default SQL queries that 
> > come with FR or have you written your own? If you wrote your own, would you 
> > mind sharing them with us (with a description please)?
> Some defaults, some self written.
> Wouldn't mind sharing. Just need some spare time for the description...
> 
> OoLee

So, that's the changed stuff...
Basically it's just a very simple prepaid model that works on passing
the remaining "Session-Timeout" after successful authentication...
Didn't find much time for a 'description', but I changed the to field
names to something pretty obvious...

authorize_check_query = "SELECT id,username,attribute,value,op FROM
${authcheck_table} WHERE username = '%{SQL-User-Name}' AND (username =
'Internet' OR account_expires > current_timestamp OR account_expires IS
NULL) ORDER BY id"

authorize_reply_query = "SELECT id,username,attribute,value,op FROM
${authreply_table} WHERE username = '%{SQL-User-Name}' AND attribute !=
'Session-Timeout' ORDER BY id"


post_auth_query = "UPDATE ${authcheck_table} SET account_expires =
(current_timestamp + contract_value) WHERE username = '%{SQL-User-Name}'
AND account_expires IS NULL; UPDATE ${authreply_table} SET value =
(SELECT split_part(EXTRACT(EPOCH FROM account_expires -
current_timestamp), '.', 1) FROM ${authcheck_table} WHERE username =
'%{SQL-User-Name}') WHERE username = '%{SQL-User-Name}' AND attribute =
'Session-Timeout' "

post_auth_reply_query = "SELECT id,username,attribute,value,op FROM
${authreply_table} WHERE username = '%{SQL-User-Name}' AND attribute =
'Session-Timeout' "


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

Reply via email to