Hi Rose -

On Tue, 09 Nov 1999, Rose P. San juan wrote:
>      I have tested authentication in the database using mysql, and it
> works fine now, my next problem here is ACCOUNTING, I have set MAXTIME in
> the database equal to 3600 (Session-Timeout). My question is, how will I
> be able to deduct the time used by the users ?
> 
>   Below is a fragment of radius.cfg , default in SQL :
> 
>    <AuthBy SQL>
>         Identifier SQL
>         DBSource dbi:mysql:radius
>         DBUsername root
>         DBAuth
>         AuthColumnDef 0, User-Password, check
>         AuthColumnDef 1, GENERIC, check
>         AuthColumnDef 2, Session-Timeout, reply
>         AuthSelect select password, CHECKATTR, MAXTIME from SUBSCRIBERS 
>         where  Ausername='%n'
>         AccountingStopsOnly
>         AccountingTable ACCOUNTING
>         AcctColumnDef USERNAME,User-Name
>         AcctColumnDef TIME_STAMP,Timestamp,integer
>         AcctColumnDef ACCTSTATUSTYPE,Acct-Status-Type
>         AcctColumnDef ACCTDELAYTIME,Acct-Delay-Time,integer
>         AcctColumnDef ACCTINPUTOCTETS,Acct-Input-Octets,integer
>         AcctColumnDef ACCTOUTPUTOCTETS,Acct-Output-Octets,integer
>         AcctColumnDef ACCTSESSIONID,Acct-Session-Id
>         AcctColumnDef ACCTSESSIONTIME,Acct-Session-Time,integer
>         AcctColumnDef ACCTTERMINATECAUSE,Acct-Terminate-Cause
>         AcctColumnDef NASIDENTIFIER,NAS-Identifier
>         AcctColumnDef NASPORT,NAS-Port,integer
>         AcctColumnDef FRAMEDIPADDRESS,Framed-IP-Address
>         AcctColumnDef TIME_STAMP,Timestamp,formatted-date,to_date(''%e %m%Y %
>         AcctSQLStatement update ACCOUNTING set 
>MAXTIME=MAXTIME-0%{Acct-Session-Time},OCTETSINLEFT=OCTETSINLEFT-0%{Acct-Input-Octets},
>         OCTETSOUTLEFT=OCTETSOUTLEFT=OCTETSOUTLEFT-0%{Acct-Output-Octets}
>         where USERNAME='%n'
>  </AuthBy SQL>
> <SessionDatabase SQL>
> 

The problem is that MAXTIME is defined in the SUBSCRIBERS table and you are
trying to refer to it in the ACCOUNTING table. You will have to modify your
AcctSQLStatement to refer to both tables.

hth

Hugh


--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, etc etc on Unix, Win95/8,
NT, Rhapsody

===
Archive at http://www.thesite.com.au/~radiator/
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to