Skip Menu |

This queue is for tickets about the RT-Authen-ExternalAuth CPAN distribution.

Report information
The Basics
Id: 66867
Status: resolved
Priority: 0/
Queue: RT-Authen-ExternalAuth

People
Owner: Nobody in particular
Requestors: whorka [...] hmdc.harvard.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: ExternalAuth breaks User_Local.pm
Date: Thu, 24 Mar 2011 16:12:31 -0400
To: bug-RT-Authen-ExternalAuth [...] rt.cpan.org
From: "William J. Horka" <whorka [...] hmdc.harvard.edu>
Hi, I noticed after installing RT::Authen::ExternalAuth that our custom local/lib/RT/User_Local.pm module wasn't working anymore to redefine RT::User::Create(). This seems to be due to something that happens in local/plugins/RT-Authen-ExternalAuth/html/Callbacks/ExternalAuth/autohandler/Auth. There's a comment in that file that says that it's there to "Temporarily force RT to reload RT::User, since it isn't being loaded correctly as a plugin." and that is is to "Work around a bug in the RT 3.8.0 and 3.8.1 plugin system (fixed in 3.8.2)". It then proceeds to delete $INC{'RT/User.pm'}, $INC{'RT/User_Overlay.pm'}, and $INC{'RT/User_Vendor.pm'}, and then "require RT::User;" to reload them. However, since it doesn't delete $INC{'RT/User_Local.pm'}; too, any functions in User_Local.pm that were intended to override functions in User.pm, User_Overlay.pm, or User_Vendor.pm will be lost. A simple patch to fix this is attached. It might also be worth wrapping the code in a conditional that checks the RT version to see if it's even necessary to reload the modules. Overall, this is a great module. Very useful for enabling LDAP authentication to RT. Thanks! Regards, -Bill -- William Horka UNIX Systems Administrator Harvard-MIT Data Center
--- orig/html/Callbacks/ExternalAuth/autohandler/Auth 2011-03-24 15:45:19.066948000 -0400 +++ patched/html/Callbacks/ExternalAuth/autohandler/Auth 2011-03-24 15:46:06.516775000 -0400 @@ -16,6 +16,7 @@ delete $INC{'RT/User.pm'}; delete $INC{'RT/User_Overlay.pm'}; delete $INC{'RT/User_Vendor.pm'}; + delete $INC{'RT/User_Local.pm'}; require RT::User; } ###################################################################################
Thanks for the patch, I actually went a slightly different route and just removed that code and marked the current development versions as 'need 3.8.2' If you do decide to upgrade, please note the upgrade warnings in README.