Question about SQLcounter and reject sessions
Hi everybody!! I have been using Freeradius as AAA of some wireless hotspots and it works great!! After reading the Rlm_sqlcounter wiki page I started to use it, and it also works great. This is the code of my sqlcounters: sqlcounter dailycounter { counter-name = Daily-Session-Time check-name = Max-Daily-Session reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = daily query = "SELECT SUM(acctsessiontime) FROM radacct WHERE \ username='%{%k}' AND acctstarttime > FROM_UNIXTIME('%b')" } sqlcounter noresetcounter { counter-name = Max-All-Session-Time check-name = Max-All-Session sqlmod-inst = sql key = User-Name reset = never query = "SELECT (UNIX_TIMESTAMP( NOW() ) - IFNULL(UNIX_TIMESTAMP(acctst$ } Everything works fine, but now I have a question about the dailycounter: I have some users that I need to reject their sessions at midnight, because of that Im using the dailycounter... but I need that user can't login again (the user is valid only 1 day). In this moment the user can login again the next day. How can I do to invalid the user after midnight? An example of an user: radcheck table username: user1 User-Password :="" radusergroup table username: user1 groupname: 1day radusergroup table groupname: 1day Max-Daily-Session := 12000 Thanks a lot!! * **Andres Gomez*
On Wed, Aug 8, 2012 at 8:34 PM, Andres Gomez Ruiz <andres.gomez@urbalink.co> wrote:
I have some users that I need to reject their sessions at midnight, because of that Im using the dailycounter...
IIRC that's not what dailycounter is for.
but I need that user can't login again (the user is valid only 1 day). In this moment the user can login again the next day. How can I do to invalid the user after midnight?
One way to do that was mentioned in the past. Try reading the archives: http://freeradius.1045715.n5.nabble.com/Unix-TimeStamp-Based-Login-td5708187... . In particular, look at Phil's post. -- Fajar
participants (2)
-
Andres Gomez Ruiz -
Fajar A. Nugraha