Grab caller id and insert into radcheck how to

Shane Hart shane at sme-solutions.com.au
Fri Oct 7 13:22:27 CEST 2005


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



More information about the Freeradius-Users mailing list