<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi list,<br>
I'm trying to set authorize section in my default sites file.<br>
<br>
I need to allow traffic users in terms of time and bandwidth.<br>
So, my attempts were like these:<br>
<small><br>
<br>
authorize{</small><br>
<small>dailycounter<br>
<br>
if (Auth-Type == "Reject") { #I tried also
if(!ok) or if (reject)<br>
update control{<br>
Post-Auth-Type := "Access-Accept"<br>
}<br>
dailybandwidthcounter<br>
}<br>
.....<br>
}<br>
</small><br>
The control never enters the condition and the dailycounter returns
"reject"<br>
<br>
<small>Wed Aug 22 13:15:39 2012 : Info: [dailycounter] sql_xlat<br>
Wed Aug 22 13:15:39 2012 : Info: [dailycounter] expand:
%{User-Name} -> xxxxxx<br>
Wed Aug 22 13:15:39 2012 : Info: [dailycounter] sql_set_user
escaped user --> '</small><small>xxxxxx</small><small>'<br>
Wed Aug 22 13:15:39 2012 : Info: [dailycounter] expand: SELECT
SUM(acctsessiontime - GREATEST((1345586400 -
UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct
WHERE username = 'xxxxxx' AND
UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1345586400'
-> SELECT SUM(acctsessiontime -
GREATEST((1345586400 - UNIX_TIMESTAMP(acctstarttime)),
0)) FROM radacct WHERE username = '</small><small>xxxxxx</small><small>'
AND UNIX_TIMESTAMP(acctstarttime) +
acctsessiontime > '1345586400'<br>
Wed Aug 22 13:15:39 2012 : Debug: rlm_sql (sql): Reserving sql
socket id: 11<br>
Wed Aug 22 13:15:39 2012 : Info: [dailycounter] sql_xlat finished<br>
Wed Aug 22 13:15:39 2012 : Debug: rlm_sql (sql): Released sql
socket id: 11<br>
Wed Aug 22 13:15:39 2012 : Info: [dailycounter] expand:
%{sql:SELECT SUM(acctsessiontime -
GREATEST((1345586400 - UNIX_TIMESTAMP(acctstarttime)),
0)) FROM radacct WHERE username = '</small><small>xxxxxx</small><small>'
AND UNIX_TIMESTAMP(acctstarttime) +
acctsessiontime > '1345586400'} -> 327<br>
Wed Aug 22 13:15:39 2012 : Debug: rlm_sqlcounter: (Check item -
counter) is less than zero<br>
Wed Aug 22 13:15:39 2012 : Debug: rlm_sqlcounter: Rejected user </small><small>xxxxxx</small><small>,
check_item=180, counter=327<br>
<b>Wed Aug 22 13:15:39 2012 : Info: ++[dailycounter] returns
reject</b><br>
Wed Aug 22 13:15:39 2012 : Auth: Invalid user (rlm_sqlcounter:
Maximum daily usage time reached): [xxxxxx] (from client localhost
port 0 cli </small><small>xxxxxx</small><small>)<br>
Wed Aug 22 13:15:39 2012 : Info: Using Post-Auth-Type Reject</small><br>
<br>
<br>
Thank you very much for any help<br>
Regards<br>
Ilaria<br>
<pre class="moz-signature" cols="72">--
------------------------------------------------
Ilaria De Marinis
Settore Reti e Servizi
CASPUR - Via dei Tizii ,6 - 00185 Roma
e-mail: <a class="moz-txt-link-abbreviated" href="mailto:ilaria.demarinis@caspur.it">ilaria.demarinis@caspur.it</a>
------------------------------------------------</pre>
</body>
</html>