(RADIATOR) Help with AuthBy SQL

Shaun Eck shaun at btl.net
Wed Feb 20 10:39:59 CST 2002


Hi 
I am somewhat confuse about how or when Radiator issues an Accounting Request.  All I am trying to do is to update the balancetime field in the subscribers table on an informix database.  I am not sure if I need to define an AccountingTable in order for me to update the subscribers table or not.  From what I have gathered in order for me to update the subscribers table all I have to do is just issued the following statement.  Please tell me what it is that I am doing wrong.

In the radius.cfg file in the realm sql.realm and in the method AuthBy SQL I have the following.
<Realm sql.realm>
    RewriteUserName    S/^([^@]+).*/$1/
<AuthBy SQL>
    Identifier SQL
    DBSource        dbi:Infomix:tis
    DBUsername    informix
    DBAuth            l1gaw01

    AuthSelect    select password, balancetime from subscribers where (username = '%n' and                                     balancetime > 0)

    AuthColumnDef    0,Password, check
    AuthColumnDef    1,Session-Timeout, reply

    AddToReply        Service-Type = Framed-User, Framed-Protocol = PPP

    AuthSQLStatement     update subscribers set balancetime = balancetime-0%{Acct-Session-Time} 
                                      where username = '%n"
    </AuthBy>
</Realm>

The problem that I am having is I dont know how or when an accounting request is received, therefore I am unsuccessful at updating the subscribers balancetime.  Is there something outside the scope of this handler thats affecting the update statement?

Please Can you point me in the right direction

Peace!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.open.com.au/pipermail/radiator/attachments/20020220/d8728a2e/attachment.html>


More information about the radiator mailing list