Zitat von Damjan <gdamjan@mail.net.mk>:
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, i posted it 5.10.2005, but that's no problem, there are so many questions on the list and i learned a lot ;-)
but you could've modified your query like so: query = "SELECT 3600*TO_DAYS(NOW()) - MIN(TO_DAYS(AcctStartTime)) .... i think you meant 86400 (60 x 60 x 24) ?
i tried something like that too and it worked, but you see how easily the time is calculated wrong ;-) and to have a simple parameter seems to me more simple and flexible.
Alternativelly, you could use the Expire attribute, you just put a date in it, and Freeradius will calculate the Session-Timeout. but doesn't the exipre attribute have to be set to a fixed date? i want to have the account lets say three days from first usage.
regards, markus -- Markus Krause email: krause@biochem.mpg.de Computing Center Tel.: 089 - 89 40 85 99 Group Lottspeich / Proteomics Fax.: 089 - 89 40 85 98 --------------------------------------------------------------------- This message was sent using https://webmail.biochem.mpg.de If you encounter any problems please report to rz-linux@biochem.mpg.de