The UserName is initialized from the RADIUS User-Name attribute and is then subject to rewriting rules. Depending on your config and which hook is in use the value of getUserName may not be the same as the value in the attribute. If you want to know the UserName currently in use for the request use getUserName.
Frank Danielson S.V.P. Engineering ClearSky Technologies, Inc. [email protected]<mailto:[email protected]> On Aug 16, 2019, at 4:10 PM, David Rose <[email protected]<mailto:[email protected]>> wrote: Looking at cleaning up some of our hook processing and was looking through some of the example hooks provided with Radiator. While doing so I noticed there are a number of ways to get attributes and was wondering why certain methods were used in different example hooks. For example I found these for getting user names: - $p->getUserName - $p->get_attr('User-Name') - $p->getAttrByNum($Radius::Radius::USER_NAME) All seem to be capable of doing the same thing. Even in our hooks there are differences in which is used and I would prefer to change this so that our hooks are at least consistent (unless there is reason not to do so). Are there reasons to use one over the other? For example, do some have better performance or take up fewer resources? Perhaps there are specific use cases when one should be used over another? Or maybe some are decprecated and should be avoided? I just want to make sure that I make the best choices while cleaning up our own code and couldn't find anything documenting the differences. Thank you in advance for any information you provide. -- David Rose Sr. Network Engineer Office of Technology Services Illinois Institute of Technology (O) 312.567.3249<tel:312.567.3249> (F) 312.567.5968<tel:312.567.5968> [email protected]<mailto:[email protected]> _______________________________________________ radiator mailing list [email protected]<mailto:[email protected]> https://lists.open.com.au/mailman/listinfo/radiator
_______________________________________________ radiator mailing list [email protected] https://lists.open.com.au/mailman/listinfo/radiator
