Re: multiple post-auth sql queries, possible?

2006-07-13 Thread Duane Cox



Is it possible to run a module twice in one 
section... 
meaning can I run the sql module twice in the 
post-auth section ?

I am thinking I could, but I would have to call it 
by a new name and then copy the lib files to also this new name.

Thanks
Duane Cox


  - Original Message - 
  From: 
  Duane Cox 
  
  To: freeradius-users@lists.freeradius.org 
  
  Sent: Wednesday, July 12, 2006 4:24 
  PM
  Subject: multiple post-auth sql queries, 
  possible?
  
  Hello List
  
  Is there a way to have freeradius 1.1.1 send two 
  or more sql postauth queries?
  
  I tried to put together an update statement and 
  an insert statement with a "go" command, but mssql didn't like it because the 
  insert, go, update was all on the same "line"
  executing the above statement; but broken out on 
  three lines with "go" by itself, works, but I'm not sure if I can do this in 
  freeradius.
  
  So is it possible to have freeradius process sql1 
  and then sql2 in the post-auth section, if so what would be the best way to 
  set this up.
  
  here is my current config ...
  
  post-auth { sql
  
   
  Post-Auth-Type REJECT 
  { 
  sql }}
  
  and then mssql.conf contains one 
  postauth_query
  
  Thanks
  Duane Cox
  
  
  
  
  

  - List info/subscribe/unsubscribe? See 
  http://www.freeradius.org/list/users.html
- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

RE: multiple post-auth sql queries, possible?

2006-07-13 Thread Jurgen van Vliet



Hi Duane

If you use a DB backend that supports stored procedures 
(like mysql 5) you can make a procedure in your mysql server containing several 
queries.
You can evenuse IF THEN ELSE structures, 
and call that procedure from post-authas a single 
query.

like : postauth_query = "call 
postauth1('%{SQL-User-Name}');"

this calls the stored procedure postauth1 and gives the 
sql user name as parameter for the procedure to work with.

Maybe that solves your problem :)

Good luck!


Jurgen van Vliet





WANBound 
Technologies| Veldzigt 28 | 3454 PW De Meern | The 
Netherlands 

Tel: +31 30 66 61 
940 | Fax: +31 30 66 
64 339 | Email: [EMAIL PROTECTED] | Website: 
www.wanbound.com 



Van: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] 
Namens Duane CoxVerzonden: donderdag 13 juli 2006 
16:32Aan: FreeRadius users mailing listOnderwerp: Re: 
multiple post-auth sql queries, possible?

Is it possible to run a module twice in one 
section... 
meaning can I run the sql module twice in the 
post-auth section ?

I am thinking I could, but I would have to call it 
by a new name and then copy the lib files to also this new name.

Thanks
Duane Cox


  - Original Message - 
  From: 
  Duane Cox 
  
  To: freeradius-users@lists.freeradius.org 
  
  Sent: Wednesday, July 12, 2006 4:24 
  PM
  Subject: multiple post-auth sql queries, 
  possible?
  
  Hello List
  
  Is there a way to have freeradius 1.1.1 send two 
  or more sql postauth queries?
  
  I tried to put together an update statement and 
  an insert statement with a "go" command, but mssql didn't like it because the 
  insert, go, update was all on the same "line"
  executing the above statement; but broken out on 
  three lines with "go" by itself, works, but I'm not sure if I can do this in 
  freeradius.
  
  So is it possible to have freeradius process sql1 
  and then sql2 in the post-auth section, if so what would be the best way to 
  set this up.
  
  here is my current config ...
  
  post-auth { sql
  
   
  Post-Auth-Type REJECT 
  { 
  sql }}
  
  and then mssql.conf contains one 
  postauth_query
  
  Thanks
  Duane Cox
  
  
  
  
  

  - List info/subscribe/unsubscribe? See 
  http://www.freeradius.org/list/users.html
- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

multiple post-auth sql queries, possible?

2006-07-12 Thread Duane Cox



Hello List

Is there a way to have freeradius 1.1.1 send two or 
more sql postauth queries?

I tried to put together an update statement and an 
insert statement with a "go" command, but mssql didn't like it because the 
insert, go, update was all on the same "line"
executing the above statement; but broken out on 
three lines with "go" by itself, works, but I'm not sure if I can do this in 
freeradius.

So is it possible to have freeradius process sql1 
and then sql2 in the post-auth section, if so what would be the best way to set 
this up.

here is my current config ...

post-auth { sql

 
Post-Auth-Type REJECT 
{ 
sql }}

and then mssql.conf contains one 
postauth_query

Thanks
Duane Cox



- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html