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

Marinko Tarlac mangia81 at gmail.com
Mon Mar 16 11:50:41 CET 2009


also try with UNION ...

On Mon, Mar 16, 2009 at 10:39 AM, <tnt at kalik.net> wrote:

> >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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20090316/fba1ce03/attachment.html>


More information about the Freeradius-Users mailing list