Why does 'switch' and case don't work?

Alan DeKok aland at deployingradius.com
Tue Nov 21 14:15:40 CET 2017


On Nov 21, 2017, at 4:54 AM, luckydog xf <luckydogxf at gmail.com> wrote:
>   switch statement in post-auth section doesn't work, see below.

  Yes, they do work.  There are tests that run every day for them.

> =============
> switch &LDAP-Group {

  You can't look at the value of LDAP-Group like that.  You can do:

	if (LDAP-Group == "admins") ...

  That checks of the user is part of the "admins" group.  But the user may be part of tens to thousands of LDAP groups.  All of those values are stored in the LDAP server, not in FreeRADIUS

  Change the "switch" to use if / else, and it will work.

  Alan DeKok.




More information about the Freeradius-Users mailing list