Forum Discussion
Hamish
Oct 05, 2016Cirrocumulus
Apologies... I read this at least two ways...
Do you mean you want to return the value (strCountryAuthorization in your code) and then convert it to lower case?
Use
[string tolower $variable]
Returns string with all the letters converted from upper to lower case.
This should do what you're asking for. Simply use the [string tolower $variable] TCL command to convert the string. e.g.
when ACCESS_POLICY_AGENT_EVENT {
if { [set strCountryAuthorization [class match -value $strCountryCode contains Blocked_Countries_dg]] ne "" } {
} else {
set strCountryAuthorization "allowed"
}
Terminate Session if Country is Blocked
if {[string tolower $strCountryAuthorization] eq "blocked"} {
Kill Session
ACCESS::session remove
}
}
I'm not sure if you use strCountryAuthorization elsewhere if it's set to 'allowed'. If not, then that 'else' setting it to allowed is wasted CPU cycles.