Re: Rejecting User By their Calling-Station-Id (Mac Address)
As suggested I just tried to replace operator = with := and even with == but reply message is not getting outputted :( Maybe I'm missing something? if (Calling-Station-Id == "%{sql: SELECT mac FROM `lrc_banlist` WHERE mac='%{Calling-Station-Id}'}") { reject update reply{ Reply-Message := "Hello Hello Hello" } } On Sat, Dec 26, 2009 at 12:08 PM, Alex M <freeradius@lrcommunications.net>wrote:
lol true! I always use that one for reply messages... i guess i was too sleepy last night :( Thank you!
On Sat, Dec 26, 2009 at 11:19 AM, Arran Cudbard-Bell < a.cudbard-bell@sussex.ac.uk> wrote:
On 26/12/2009 08:05, Alex M wrote:
Ok I still having trouble with this. Here is my code:
========================================================================================
if (Calling-Station-Id == "%{sql: SELECT mac FROM `lrc_banlist` WHERE mac='%{Calling-Station-Id}'}") { reject
update reply { Reply-Message = "Hello Hello Hello" }
}
Wrong operator.
You want := to overwrite the attribute value that already exists...
update reply { Reply-Message := "Hello Hello Hello" }
On 26/12/2009 10:11, Alex M wrote:
As suggested I just tried to replace operator = with := and even with == but reply message is not getting outputted :( Maybe I'm missing something? Try moving the reject to after the update stanza. I think a return code of reject stops the server processing the current section.
-Arran
that worked well! thank you I guess once reject is sent there is no further processing of the code. On Sat, Dec 26, 2009 at 1:16 PM, Arran Cudbard-Bell < a.cudbard-bell@sussex.ac.uk> wrote:
On 26/12/2009 10:11, Alex M wrote:
As suggested I just tried to replace operator = with := and even with == but reply message is not getting outputted :( Maybe I'm missing something?
Try moving the reject to after the update stanza. I think a return code of reject stops the server processing the current section.
-Arran
On 26/12/2009 11:23, Alex M wrote:
that worked well! Good :) thank you I guess once reject is sent there is no further processing of the code. Yeah similar behaviour to handled. It's why you have to override the return codes of modules if you want to do additional processing after a reject.
e.g. Authenticate { eap { reject = 1 } if(reject){ do more stuff... } } -Arran
On Sat, Dec 26, 2009 at 1:16 PM, Arran Cudbard-Bell <a.cudbard-bell@sussex.ac.uk <mailto:a.cudbard-bell@sussex.ac.uk>> wrote:
On 26/12/2009 10:11, Alex M wrote:
As suggested I just tried to replace operator = with := and even with == but reply message is not getting outputted :( Maybe I'm missing something?
Try moving the reject to after the update stanza. I think a return code of reject stops the server processing the current section.
-Arran
participants (2)
-
Alex M -
Arran Cudbard-Bell