> query = "SELECT TO_DAYS(NOW()) - MIN(TO_DAYS(AcctStartTime)) FROM radacct 
> WHERE
> UserName = '%{%k}' LIMIT 1";
> 
> this actually works very well, a user logs in and is allowed to access to the
> network until the date changes e.g. the second time if he is allowed access 
> for
> two days. but as i am saving the days as "days" in the mysql database, i run
> into trouble with "Session-Timeout" because rlm_sqlcounter assumes that the
> query returns seconds and the user gets a session timeout of the remaining 
> days
> as seconds (a value between 1 and 7!). putting the day limit as seconds into
> the database does (in my case/opinion) not make any sense here.

Hmm.. this is the first time I see your question, but you could've
modified your query like so:
query = "SELECT 3600*TO_DAYS(NOW()) - MIN(TO_DAYS(AcctStartTime)) ....

Alternativelly, you could use the Expire attribute, you just put a date
in it, and Freeradius will calculate the Session-Timeout.

-- 
damjan | дамјан
This is my jabber ID --> [EMAIL PROTECTED] <-- not my mail address!!!
- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to