Security

Reply
Occasional Contributor II
Posts: 11
Registered: ‎12-13-2010

Amigopod as RADIUS server - Condition Expression

I need to have the RADIUS server return a specific IP address back but only if a specific user ID is used. I've created a user role and put in the correct attribute, and that works just fine. However I want to add a condition expression that allows the radius attribue to be returned only if the condition is met. That condition would be the user ID. 


I can't figure out the syntax. I understand its PHP and i know that well, but I'm not sure how it wants it in that expression.

 

return ($userid == "testuser1);

 

or something like that?

 

Thanks for your time.


Eric 

Occasional Contributor II
Posts: 11
Registered: ‎12-13-2010

Re: Amigopod as RADIUS server - Condition Expression

I found something that works. Just wonderign if this is the correct way to do it. I'll need to create one of these for each device that needs to get fed an IP address back, so the least cumbersome the better.

 

<?php if (GetAttr("user-name") == "actual_user_name") { return true; }

 

This is the conditional expression of a Framed-IP-Address attribute.

Aruba
Posts: 113
Registered: ‎11-21-2011

Re: Amigopod as RADIUS server - Condition Expression

Your solution should work, however the following might be a little bit cleaner:

 

return GetAttr("user-name") == "actual_user_name"

 You don't need the <?php tag, and you can short-cut a simple Boolean condition like this.

Occasional Contributor II
Posts: 11
Registered: ‎12-13-2010

Re: Amigopod as RADIUS server - Condition Expression


amigodave wrote:

Your solution should work, however the following might be a little bit cleaner:

 

return GetAttr("user-name") == "actual_user_name"

 You don't need the <?php tag, and you can short-cut a simple Boolean condition like this.


Worked great! Thanks!

Search Airheads
Showing results for 
Search instead for 
Did you mean: