how to have freeradius/unlang do two or more SQL statements at onetime

Dave Sinclair jmb287 at gmail.com
Mon Mar 16 15:15:11 CET 2009


Hi

Tried this, but it tossed out errors at me :(

2009/3/16  <tnt at kalik.net>:
>>When Post-Auth-Type REJECT is executed I need to insert two or more
>>rows into a SQL data base.
>>
>>here is what I have at present
>>
>>
>>sites-enabled/default
>>
>>        Post-Auth-Type REJECT {
>>                sql
>>        }
>>
>>sql.conf -> sql/mysql/dialup.conf
>>
>>
>>        postauth_query = "INSERT INTO ${authcheck_table} VALUES
>>(NULL,'%{User-Name}','Password', '==',
>>'%{User-Password:-Chap-Password}');"
>>        postauth_query = "INSERT INTO ${usergroup_table} values
>>('%{User-Name}','Dynamic','');"
>>
>>
>>The FIRST insert runs, but the second one doesn't.
>>
>
> Yes, only one gets executed. Try this:
>
> postauth_query = "INSERT INTO ${authcheck_table} ... ; INSERT INTO
> ${usergroup_table} ... "
>
> If that doesn't work you will have to do inserts with perl.
>
> Ivan Kalik
> Kalik Informatika ISP
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>




More information about the Freeradius-Users mailing list