I have
in radgroupcheck
GroupName   Attribute                       op  Value
14 days Session-Terminate := 1209600 (Time for 14 days from first connection)


in usergroup
GroupName      UserName
14 days            aaa

in radcheck
UserName      Attribute                   op  Value
aaa               UserPassword             == pepe
aaa Session-Terminate += 86400 (Time for 1 day to Add to Session-Terminate)

@radiusd.conf
modules {
         ............
         sqlcounter sessionterminate {
                       counter-name = Session-Limit-Time
                       check-name = Session-Terminate
                       reply-name = Session-Timeout
                       sqlmod-inst = sql
                       key = User-Name
                       reset = never
query = "SELECT IF (UNIX_TIMESTAMP((SELECT MIN(AcctStartTime) FROM radacct WHERE UserName='%{%k}'))>0, UNIX_TIMESTAMP() - UNIX_TIMESTAMP((SELECT MIN(AcctStartTime) FROM radacct WHERE UserName='%{%k}'))),0)"
        }
        ...........
}
instantiate {
               .....
               sessionterminate
              ......
}

authorize {
             ..........
             sql
             sessionterminate
             .........
}

Ok, when send the authentication request, everything work fine but
in reply Session-Timeout = 86400 so the radius overwrite the value not add.

rad_recv: Access-Request packet from host 172.16.0.3:2353, id=115, length=44
        User-Name = "aaa1"
        User-Password = "pepe"
rlm_sql (sql): Reserving sql socket id: 4
rlm_sql_mysql: query: SELECT id, UserName, Attribute, Value, op FROM radcheck WHERE Username = 'aaa1' ORDER BY id rlm_sql_mysql: query: SELECT radgroupcheck.id,radgroupcheck.GroupName,radgroupcheck.Attribute,radgroupcheck.Value,radgroupcheck.op FROM radgroupcheck,usergroup WHERE usergroup.Username = 'aaa1' AND usergroup.GroupName = radgroupcheck.GroupName ORDER BY radgroupcheck.id rlm_sql_mysql: query: SELECT id, UserName, Attribute, Value, op FROM radreply WHERE Username = 'aaa1' ORDER BY id rlm_sql_mysql: query: SELECT radgroupreply.id,radgroupreply.GroupName,radgroupreply.Attribute,radgroupreply.Value,radgroupreply.op FROM radgroupreply,usergroup WHERE usergroup.Username = 'aaa1' AND usergroup.GroupName = radgroupreply.GroupName ORDER BY radgroupreply.id
rlm_sql (sql): Released sql socket id: 4
radius_xlat: Running registered xlat function of module sql for string 'SELECT IF(UNIX_TIMESTAMP((SELECT MIN(AcctStartTime) FROM radacct WHERE UserName='aaa1'))>0,(UNIX_TIMESTAMP()-UNIX_TIMESTAMP((SELECT MIN(AcctStartTime) FROM radacct WHERE UserName='aaa1'))),0)'
rlm_sql (sql): - sql_xlat
rlm_sql (sql): Reserving sql socket id: 3
rlm_sql_mysql: query: SELECT IF(UNIX_TIMESTAMP((SELECT MIN(AcctStartTime) FROM radacct WHERE UserName='aaa1'))>0,(UNIX_TIMESTAMP()-UNIX_TIMESTAMP((SELECT MIN(AcctStartTime) FROM radacct WHERE UserName='aaa1'))),0)
rlm_sql (sql): - sql_xlat finished
rlm_sql (sql): Released sql socket id: 3
rlm_sql (sql): Reserving sql socket id: 2
rlm_sql_mysql: query: SELECT COUNT(*) FROM radacct WHERE UserName='aaa1' AND AcctStopTime = 0
rlm_sql (sql): Released sql socket id: 2
rlm_sql (sql): Processing sql_postauth
rlm_sql (sql): Reserving sql socket id: 1
rlm_sql_mysql: query: INSERT into radpostauth (id, user, pass, reply, date) values ('', 'aaa1', 'pepe', 'Access-Accept', NOW())
rlm_sql (sql): Released sql socket id: 1
Sending Access-Accept of id 115 to 172.16.0.3 port 2353
        Reply-Message += "Hola  aaa1\\r\\n"
        WISPr-Bandwidth-Max-Down := 200000
        WISPr-Bandwidth-Max-Up := 20000
        Acct-Interim-Interval := 120
        Idle-Timeout := 390
        Session-Timeout = 86400

I did that before with freeradius 1.0.2 but stop to work and I don't know why. I install the new freeradius 1.1.5, Wow is to better and more easy, but my problem continue, I guess I forget something, please if someone have any idea why the operators doesn't work. Can help me?
Thanks.

Fabián Franzotti

_________________________________________________________________
With tax season right around the corner, make sure to follow these few simple tips. http://articles.moneycentral.msn.com/Taxes/PreparationTips/PreparationTips.aspx?icid=HMFebtagline

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to