Filtering in sites-enabled default file

Nick Sparkes n.sparkes at worc.ac.uk
Wed Jun 3 13:29:27 CEST 2009


Hello,

 

I was wandering if anyone can help me.  I am trying to set up freeradius
2.1.x

 

In the authorized section of default, we have the following coding:

 

 

if("%{User-Name}" =~ /\\\\?([^@\\\\]+)@?([-[:alnum:]._]*)?$/) {

        update request {

               Realm := "%{2}"

        }

        if(!"%{2}" || ("%{2}" == "worc.ac.uk") || ("%{2}" ==
"worcester.ac.uk") ){

                update request {

                        Realm := "worc"

                }

        }

}

 

 

else{

        update request {

                Stripped-User-Name := "anonymous"

                Realm := 'local'

        }

}

 

 

 

switch "%{Realm}" {

        case "worc" {

                update control {

                       Proxy-To-Realm := "worc"

                }

                update request {

                       Realm := "worc"

                }

         # Don't do any proxy stuff here, request will be handled later.

        }

        case {

                update control {

                        Proxy-To-Realm := "jrs"

                }

                update request {

                       Realm := "jrs"

                }

        }

}

 

This should check the extension to the user name, if it is worc or Worcester
it will use the realm "worc", if it is anonymous, use the "local" realm.
Otherwise use the "jrs" realm. Which works fine. There is a problem, as our
users are split into 2 separate section, staff & students. 

 

Above works fine for staff, as the realm "worc" handles this authentication.
But we do need to filter the students & place these in another realm,
"student".  

 

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.

 

Regards,

 

Nick.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20090603/891e6e70/attachment.html>


More information about the Freeradius-Users mailing list