Hello again,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I'm working with Freeradius 2.1.8<br><br>I'm using session (sql) to control simultaneous use.<br>
<br>I would like to return a special value if an user try to access with credentials in use.<br></blockquote><div><br>I have it working adding a new attribute to request list whit the result of the simul_count_query, and checking this value later in post_auth section.<br>
<br><span><span>session {<br> if ("%{Realm}" == "<a href="http://xxx.es/" target="_blank">xxx.es</a>") {<br></span></span> update request {<br> Num-Open-Session := "%{sql:SELECT COUNT(*) FROM radacct WHERE username = '%{SQL-User-Name}' AND acctstoptime IS NULL}"<br>
}<br> sql<br> }<br>}<br><br><br>post-auth {<br> sql<br> if (fail) {<br> update reply {<br> Codigo-Reject := Imposible-Contactar-Backend<br>
}<br> reject<br> }<br> Post-Auth-Type REJECT {<br> if ("%{request:Num-Open-Session}"){<br> update reply {<br> Codigo-Reject = Sesion-Abierta<br>
}<br> }<br> else{<br> update reply {<br> Codigo-Reject = Credenciales-Erroneas<br> }<br> }<br>
I think that this not is the better way to do, but...<br><br>Thank you very much<br><br></div></div>____________________<br><br> Ana Gallardo Gómez<br>____________________<br>