Re: Grab caller id and insert into radcheck how to

2005-10-08 Thread Shane Hart



Jonathan De Graeve wrote:


You should use: IF NOT EXISTS
 

Thanks Jonathan, I did some more testing today and came up with 
something that works for us...


Shane


Hi all,

I an attempting to add an additional attribute upon the first login for 
user accounts and I am a bit lost.

The way I am testing this is with postauth query.
postauth_query = "INSERT into ${authcheck_table} (id, UserName, 
Attribute, op, value) values('', '%{SQL-User-Name}', 
'Calling-Station-Id', '==', '%{Calling-Station-Id}' )"
This works great but it adds a new record every time the user 
successfully authenticates. Not a problem really but there are also 
users I don't need to lock to a caller id.


I tried using postauth_query = "UPDATE in various ways but I just can't 
get my head around it.
If I manually create an entry in radcheck for a user with the attribute 
"Calling-Station-Id" and a "NULL" value, then the user can't login 
obviously.


Does anybody have any ideas how to have this attribute somehow 
dynamically created when the user first logs in if they are a member of 
a group and ultimately not create it if the record already exists?

Any ideas or pointers greatly appreciated.
 

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


RE: Grab caller id and insert into radcheck how to

2005-10-07 Thread Jonathan De Graeve
You should use: IF NOT EXISTS

--
Jonathan De Graeve
Network/System Administrator
Imelda vzw
Informatica Dienst
015/50.52.98
[EMAIL PROTECTED]

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Shane Hart
Verzonden: vrijdag 7 oktober 2005 13:22
Aan: FreeRadius users mailing list
Onderwerp: Grab caller id and insert into radcheck how to

Hi all,

I an attempting to add an additional attribute upon the first login for 
user accounts and I am a bit lost.
The way I am testing this is with postauth query.
postauth_query = "INSERT into ${authcheck_table} (id, UserName, 
Attribute, op, value) values('', '%{SQL-User-Name}', 
'Calling-Station-Id', '==', '%{Calling-Station-Id}' )"
This works great but it adds a new record every time the user 
successfully authenticates. Not a problem really but there are also 
users I don't need to lock to a caller id.

I tried using postauth_query = "UPDATE in various ways but I just can't 
get my head around it.
If I manually create an entry in radcheck for a user with the attribute 
"Calling-Station-Id" and a "NULL" value, then the user can't login 
obviously.

Does anybody have any ideas how to have this attribute somehow 
dynamically created when the user first logs in if they are a member of 
a group and ultimately not create it if the record already exists?
Any ideas or pointers greatly appreciated.

Thanks

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




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