SOLVED: RE: Help pls: How to strip REALM but insert it from a username at MAC onto an MySQL DB
Lucio Godoy
luciocfgodoy at hotmail.com
Tue Jan 26 16:00:50 CET 2010
Hi All;
With your help i have managed to get Radius to do what i needed, thanks.
Basically i have placed the following into the sites-available/default file on the authorize and accounting areas:
if(User-Name){
if ("%{User-Name}" =~ /^(.{6,32})(@{1})(.{17})$/){
update request {
User-Name := "%{1}"
Realm := "%{3}"
}
}
else {
reject
}
}
The Regex will allow:
Usernames from 6 to 32 characters;
Only one @ sign, and
32 Chars for the MAC Address
Users without the @ MAC_ADDRESS will be dropped.
With that REGEX true the Username and Realm are updated respectively on my MySQL DB.
Next time anybody is around Windsor UK, let me know (email at the top) i'll treat you for a pint(s) of Stella and a Kebab
Thanks again
Lucio
_________________________________________________________________
Tell us your greatest, weirdest and funniest Hotmail stories
http://clk.atdmt.com/UKM/go/195013117/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20100126/e564c1cd/attachment.html>
More information about the Freeradius-Users
mailing list