Hi, I'm tryin to setup radius accounts that expire after a predetermined ammount of usage time (eg 5 hours) and are only valid for a predetermined number of days (eg 30 days) after the first login.
I've setup an sql counter 'noresetcounter' that counts the online time: sqlcounter noresetcounter { counter-name = Max-All-Session-Time check-name = Max-All-Session sqlmod-inst = sql key = User-Name reset = never query = "SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='%{%k}'" } this works fine until I setup another counter 'validitycounter', that checks the number of days since the first login: sqlcounter validitycounter { counter-name = Total-Usage-Days check-name = Relative-Validity sqlmod-inst = sqlcca3 key = User-Name reset = never query = "SELECT ((UNIX_TIMESTAMP(CURDATE()) - UNIX_TIMESTAMP(MIN(AcctStartTime))) / 86400) from radacct WHERE UserName = '%{%k}'" } radius now sends the Relative-Validity as the Session-Timeout. I've tried having the 'validitycounter' before the 'noresetcounter' and the other way round but it still does the same. Is there a way to make this work? Thanks ===== Julius Igugu SouthWork Co. Ltd. 234 (802) 320-7540 __________________________________ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html