[Rt-devel] Replacing WebExternalAuthInfo in 3.0.11

Scott Russell lnxgeek at us.ibm.com
Thu Jul 8 16:16:09 EDT 2004


Greets.

I'm a new RT user and have been digging into the docs and code. Great 
stuff online in the wiki.

Our RT instance picks up REMOTE_USER from apache and auto creates a new 
account as needed.

I am trying to replaced the WebExternalAutoInfo method found in Web.pm 
with one that will map LDAP attribs from our corporate directory to the 
accounts created in RT. I'm doing so by creating Web_Local.pm with my 
own WebExternalAutoInfo defined. I place the Web_Local.pm file in the 
same directory as the Web.pm file and have verified that Web.pm 
correctly finds and loads Web_Local.pm after RT is restarted.

I know WebExternalAutoInfo in Web.pm is called when a new user is 
created because of the RT::Logger->debug statement I added to verify RT 
calls it. This tells me my RT_SiteConfig is correct.

What fails is the WebExternalAutoInfo method in Web_Local.pm does not 
override the previously defined WebExternalAutoInfo method in Web.pm.

Taking a look at the included Web_Local.pm can anyone give me hints as 
to why my WebExternalAutoInfo method isn't being called by RT?

Thanks much.


no warnings qw(redefine);
use strict;

=head2 WebExternalAutoInfo($user);

Returns a hash of user attributes, used when WebExternalAuto is set.

=cut

# {{{ sub WebExternalAuthInfo

sub WebExternalAutoInfo {
         my $user = shift;
         my %user_info;

         $user_info{'Privileged'} = 1;

         # some debug where real code will some day go
         $user_info{'RealName'} = "John Doe";
         $RT::Logger->debug("Gather info for $user");

         return {%user_info};
}

# }}}

1;

-- 
Scott Russell <lnxgeek at us.ibm.com>
IBM Linux Technology Center


More information about the Rt-devel mailing list