Hello again,

I'm working with Freeradius 2.1.8
>
> I'm using session (sql) to control simultaneous use.
>
> I would like to return a special value if an user try to access with
> credentials in use.
>

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.

session {
        if ("%{Realm}" == "xxx.es") {
                update request {
                        Num-Open-Session := "%{sql:SELECT COUNT(*) FROM
radacct WHERE username = '%{SQL-User-Name}' AND acctstoptime IS NULL}"
                }
                sql
        }
}


post-auth {
        sql
        if (fail) {
                update reply {
                        Codigo-Reject := Imposible-Contactar-Backend
                }
                reject
        }
        Post-Auth-Type REJECT {
                if ("%{request:Num-Open-Session}"){
                        update reply {
                                Codigo-Reject = Sesion-Abierta
                        }
                }
                else{
                        update reply {
                                Codigo-Reject = Credenciales-Erroneas
                        }
                }
I think that this not is the better way to do, but...

Thank you very much

____________________

  Ana Gallardo Gómez
____________________
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to