On May 17, 2008, at 6:31 AM, Krzysztof Olędzki wrote:
On 2008-05-17 02:09, Chris wrote:
I basically want User-Name to be forced to lowercase for the
duration of the request.
I have done the following:
modules {
perl {
module = my_perl_module.pm
}
}
authorize {
preprocess
perl
...
}
Pertinent contents of my_perl_module.pm:
sub authorize {
$RAD_REQUEST{'User-Name'} =~ tr/A-Z/a-z/;
return RLM_MODULE_OK;
}
This seems to do what I want. Is it the correct way to accomplish
this task?
lc EXPR
lc Returns a lowercased version of EXPR. This is the internal
function implementing the "\L" escape in double-quoted
strings.
Respects current LC_CTYPE locale if "use locale" in force.
See
perllocale and perlunicode for more details about locale and
Unicode support.
If EXPR is omitted, uses $_.
Thanks. I'll look at lc.
I was actually more concerned about the interfacing with freeradius
than the perl itself.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html