Filtering in sites-enabled default file

A.L.M.Buxey at lboro.ac.uk A.L.M.Buxey at lboro.ac.uk
Wed Jun 3 13:53:32 CEST 2009


Hi,

> if("%{User-Name}" =~ /\\\\?([^@\\\\]+)@?([-[:alnum:]._]*)?$/) {
> 
>         update request {
> 
>                Realm := "%{2}"
> 
>         }
> The staff login id is:
> 
> Psna1 at worc.ac.uk
> 
> Whereas the student login is in the format:
> 
> Psdn1_03 at worc.ac.uk
> 
> Would it be possible to filter on the format of the userid? The student id
> has `_02 on it.

yes, easily... eg

  if("%{User-Name}" =~ /_02@/) {
   update request {
		Realm := "student"
	}	
   }

it can be made scalable and more pretty but this would suffice for this question

alan



More information about the Freeradius-Users mailing list