On 10/27/2011 12:10 PM, SimonM123 wrote:

> If I've posted this twice, I'm sorry - couldn't find the email I sent
> yesterday.

Probably did not reach the list. I did not see it either.

> We're using the Max-All and Max-Daily session in a customised sql.cfg.
> 
> 
>         AuthColumnDef     0,User-Password, check
>         AuthColumnDef     1,Max-Daily-Session,check
>         AuthColumnDef     2,Session-Timeout,reply
> 
> 
>         AuthSelect select PASSWORD, MAXDAILYSESSION, SESSIONTIMEOUT from
> SUBSCRIBERS where USERNAME=%0
> 
> 
>         AcctTotalQuery SELECT SUM(AcctSessionTime) FROM ACCOUNTING WHERE
> UserName=%0

The above should run when Max-All-Session is a check item.

>         AcctTotalSinceQuery SELECT SUM(AcctSessionTime - GREATEST((%1 -
> UNIX_TIMESTAMP(AcctStartTime)), 0)) FROM ACCOUNTING WHERE UserName=%0 AND
> UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > %1

This should run with Max-Daily-Session. So it should run for your
Max-Daily-Session check item. When you run Radiator with Trace 4 you
should see this query in Radiator log when it runs.

>        AcctSQLStatement update SUBSCRIBERS set SESSIONTIMEOUT =
> SESSIONTIMEOUT - 0%{AcctTotalSinceQuery} where USERNAME='%n'
> 
> The last one I thought might decrease the session timeout on successful auth
> but it's not working.

Try 0%{Acct-Session-Time} instead of 0%{AcctTotalSinceQuery}. This will
try to minus the value of Acct-Session-Time attribute for every received
accounting message. Also, it runs when accounting message is received,
not during auth(entication).

You should see this in Trace 4 log too.

> What's the best way to do this?

Does the above help?

Heikki


-- 
Heikki Vatiainen <[email protected]>

Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS,
NetWare etc.
_______________________________________________
radiator mailing list
[email protected]
http://www.open.com.au/mailman/listinfo/radiator

Reply via email to