Hi All, How can I reference to check items using unlang? When I use perl script , simply reference it by $RAD_CHECK. For example I want to check if there is a check item in sql user profile , then do some actions using unlang and if not then ignore it. By the way I know that I can do that by querying sql in unlang but I wondering if there is a better way for doing that. Could you please help me? Regards, Nasser
On 20 May 2013, at 03:03, Nasser Heidari <nasser@rasana.net> wrote:
Hi All,
How can I reference to check items using unlang? When I use perl script , simply reference it by $RAD_CHECK. For example I want to check if there is a check item in sql user profile , then do some actions using unlang and if not then ignore it. By the way I know that I can do that by querying sql in unlang but I wondering if there is a better way for doing that.
control:<Attribute> Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
I've already tried and it doesn't work. for example I want to check for existence of a custom check-item in user profiles with unlang, I try this: If(control:custom_check_item) { ... } This always returns true in my case , doesn't matter if a user have custom_check_item in his profile or not. -----Original Message----- From: freeradius-users-bounces+nasser=rasana.net@lists.freeradius.org [mailto:freeradius-users-bounces+nasser=rasana.net@lists.freeradius.org] On Behalf Of Arran Cudbard-Bell Sent: Monday, May 20, 2013 4:02 PM To: FreeRadius users mailing list Subject: Re: reference to check items using unlang On 20 May 2013, at 03:03, Nasser Heidari <nasser@rasana.net> wrote:
Hi All,
How can I reference to check items using unlang? When I use perl script , simply reference it by $RAD_CHECK. For example I want to check if there is a check item in sql user profile , then do some actions using unlang and if not then ignore it. By the way I know that I can do that by querying sql in unlang but I wondering if there is a better way for doing that.
control:<Attribute> Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Nasser Heidari wrote:
I've already tried and it doesn't work.
That's a fairly useless response.
for example I want to check for existence of a custom check-item in user profiles with unlang, I try this:
If(control:custom_check_item) { ... }
This always returns true in my case , doesn't matter if a user have custom_check_item in his profile or not.
That's not how unlang works. If an attribute doesn't exist, then checking for it returns "false". And you're trying to look for *SQL* profiles via the above check? That will work only if the SQL module was configured, was used, and then returned the profile. You need to run the server in debugging mode in order to see what's happening. We tell people this in the FAQ, README, "man" page, web pages, and daily on this list. There is *no* excuse for failing to look at the debug output. Alan DeKok.
participants (3)
-
Alan DeKok -
Arran Cudbard-Bell -
Nasser Heidari