Hi, On Wed, 3 Apr 2002, Pasi K�rkk�inen wrote:
> I'd like to implement following scenario with openradius or freeradius: > > User has some specific time (say 3600 seconds) one can use. After the > time is exceeded, radiusd return zero seconds as access-time for the user > when one logs in. > > NAS requests allowed access-time when user logs in and returns used time > to radiusd when user logs off. > > I'd like to store this information in sql-database (mysql). > Has anyone already done something like this? Any ideas how to do this? Basically what you need is a session database combined with a 'seconds left' field. As part of the authentication process, the server must also check whether 'seconds left' >= 0, and if not, reject the user, otherwise, include a Session-Timeout attribute in the reply that specifies this value. As part of the accounting process, the server must deduct the value of the received Acct-Session-Time attribute from the 'seconds left' field. OpenRADIUS is well suited for this sort of thing, but there's no read/write DBM or MySQL module yet. It shouldn't take long to write a simple one in Perl, PHP or Python though. FreeRADIUS has a MySQL module, but I don't know if it can be used to hold the session DB. It probably does though. It's also has a counter module that could be used to keep the 'seconds left' value, but it uses GDBM instead of MySQL for storage. Cheers, Emile. -- E-Advies / Emile van Bergen | [EMAIL PROTECTED] tel. +31 (0)70 3906153 | http://www.e-advies.info - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
