[Bps-public-commit] r20274 - in RT-Authen-ExternalAuth/trunk/html: Elements

falcone at bestpractical.com falcone at bestpractical.com
Fri Feb 18 18:59:07 EST 2011


Author: falcone
Date: Fri Feb 18 18:59:07 2011
New Revision: 20274

Added:
   RT-Authen-ExternalAuth/trunk/html/Callbacks/ExternalAuth/autohandler/Session
   RT-Authen-ExternalAuth/trunk/html/Elements/
   RT-Authen-ExternalAuth/trunk/html/Elements/DoAuth
      - copied, changed from r20273, /RT-Authen-ExternalAuth/trunk/html/Callbacks/ExternalAuth/autohandler/Auth
Modified:
   RT-Authen-ExternalAuth/trunk/html/Callbacks/ExternalAuth/autohandler/Auth

Log:
Work around some changes to Login flow in 3.8.9 and 4.0

In 3.8.9/4.0, we now need to hook the earlier callback, Session, in
order to avoid being skipped by the MaybeShowNoAuthPage method since
we're using a /NoAuth/Login.html page to collect login information.

This degrades nicely on 3.8.8 since the Session callback isn't called.

The Auth callback will get invoked on 3.8.9 but should bail quickly
because the user is logged in already.

Modified: RT-Authen-ExternalAuth/trunk/html/Callbacks/ExternalAuth/autohandler/Auth
==============================================================================
--- RT-Authen-ExternalAuth/trunk/html/Callbacks/ExternalAuth/autohandler/Auth	(original)
+++ RT-Authen-ExternalAuth/trunk/html/Callbacks/ExternalAuth/autohandler/Auth	Fri Feb 18 18:59:07 2011
@@ -1,36 +1 @@
-<%once>
-my $loaded_user = 0;
-</%once>
-<%init>
-
-use RT::Authen::ExternalAuth;
-
-###################################################################################
-# Work around a bug in the RT 3.8.0 and 3.8.1 plugin system (fixed in 3.8.2)      #
-# Temporarily force RT to reload RT::User, since it isn't being loaded            #
-# correctly as a plugin.                                                          #
-###################################################################################
-unless ($loaded_user) {                                                           
-    $RT::Logger->debug("Reloading RT::User to work around a bug in RT-3.8.0 and RT-3.8.1");
-    $loaded_user++;
-    delete $INC{'RT/User.pm'};
-    delete $INC{'RT/User_Overlay.pm'};
-    delete $INC{'RT/User_Vendor.pm'};
-    require RT::User;
-}
-###################################################################################
-
-my ($val,$msg);
-unless($session{'CurrentUser'} && $session{'CurrentUser'}->Id) {
-    ($val,$msg) = RT::Authen::ExternalAuth::DoAuth(\%session,$user,$pass);
-    $RT::Logger->debug("Autohandler called ExternalAuth. Response: ($val, $msg)");
-}
-
-return;
-</%init>
-
-<%ARGS>
-$user => undef
-$pass => undef
-$menu => undef
-</%ARGS>
+%$m->comp('/Elements/DoAuth',%ARGS);

Added: RT-Authen-ExternalAuth/trunk/html/Callbacks/ExternalAuth/autohandler/Session
==============================================================================
--- (empty file)
+++ RT-Authen-ExternalAuth/trunk/html/Callbacks/ExternalAuth/autohandler/Session	Fri Feb 18 18:59:07 2011
@@ -0,0 +1 @@
+%$m->comp('/Elements/DoAuth',%ARGS);

Copied: RT-Authen-ExternalAuth/trunk/html/Elements/DoAuth (from r20273, /RT-Authen-ExternalAuth/trunk/html/Callbacks/ExternalAuth/autohandler/Auth)
==============================================================================
--- /RT-Authen-ExternalAuth/trunk/html/Callbacks/ExternalAuth/autohandler/Auth	(original)
+++ RT-Authen-ExternalAuth/trunk/html/Elements/DoAuth	Fri Feb 18 18:59:07 2011
@@ -10,7 +10,7 @@
 # Temporarily force RT to reload RT::User, since it isn't being loaded            #
 # correctly as a plugin.                                                          #
 ###################################################################################
-unless ($loaded_user) {                                                           
+unless ($loaded_user) {
     $RT::Logger->debug("Reloading RT::User to work around a bug in RT-3.8.0 and RT-3.8.1");
     $loaded_user++;
     delete $INC{'RT/User.pm'};
@@ -34,3 +34,4 @@
 $pass => undef
 $menu => undef
 </%ARGS>
+



More information about the Bps-public-commit mailing list