how to have freeradius/unlang do two or more SQL statements at onetime
tnt at kalik.net
tnt at kalik.net
Mon Mar 16 10:39:15 CET 2009
>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
More information about the Freeradius-Users
mailing list