(RADIATOR) Attributes that I change in 1 handler, has changed value in another handler

gdelvalle at btl.net gdelvalle at btl.net
Mon Jul 16 09:10:04 CDT 2007



Hello All,
  Here is my problem in a nutshell-

I want to add/change an attribute  in a prehandler hook (
example- I want to strip a username joe at example.com and  change
it to joe at realm1.com).  Then this should cause radiator to send
that request to  my Realm1.com handler. My assumption correct? 

problems I have -
1) when I change an attribute  it looks like it only persists for
the life of that subroutine that is the handler. I'd like when a
preauthhandler picks up the request the change I made from  the
previous handler is still there. This is an excerpt from the
subroutine that  is to  change the attribute.
2) If the changed attribute doesnt stick then it wont go to the
right handler.



   $username = $username."\@Realm1.com";
  ${$_[0]}->change_attr('User-Name', $username);

###############################
sub
{

   # I used to use assign the reference to a local variable but i
thought this would  cause the change not to be present in the
next handler.  Atrue or false
   #my p = ${$_[0]};

    #if this isnt an access request we dont want to run the  
procedure any further 
    my $code = ${$_[0]}->code();
    return unless $code eq 'Access-Request';

    my $nasaddress =
${$_[0]}->getAttrByNum($Radius::Radius::NAS_IP_ADDRESS);
    return unless $nasaddress eq '127.0.0.1';

    #Pulling some values from request structure that was passed
to to sub routine  as a reference.
 
    my $username =
${$_[0]}->getAttrByNum($Radius::Radius::USER_NAME);
    my $nasport = ${$_[0]}->getAttrByNum($Radius::Radius::NAS_PORT);

    my $timestamp = localtime time;     


   $username = $username."\@Realm1.com";
  ${$_[0]}->change_attr('User-Name', $username);

}
############################################


Any Ideas.

Regards,
Giovanni


--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list