Permalink
Browse files

Actually disable RT::Authen::ExternalAuth while importing users from …

…LDAP

The original code from 56d0d41 only stands a chance at working on RT
3.6.  RT 3.8 and 4.0 use the modern config handling and call
RT->Config->Get('Plugins') to load plugins.  Get() doesn't read values
from the RT:: namespace; it uses a secondary store which we never
affected.  By calling Set() ourselves we ensure the config is properly
updated and seen by the subsequent RT::Init() call.
  • Loading branch information...
1 parent 90716a1 commit 5ba51906d4d86670fa5c8102a0928dc9886e80c0 @tsibley tsibley committed Jul 3, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 bin/rtldapimport.in
View
@@ -12,10 +12,15 @@ use lib '/opt/rt3/local/lib /opt/rt3/lib';
use RT;
RT::LoadConfig;
-# Avoid extra user canonicalization calls by disabling RT::Authen::ExternalAuth
-# while we import users from LDAP
-@RT::Plugins = grep { $_ ne 'RT::Authen::ExternalAuth' }
- @RT::Plugins;
+if (RT->can('Config')) {
+ # Avoid extra user canonicalization calls by disabling
+ # RT::Authen::ExternalAuth while we import users from LDAP
+ RT->Config->Set(
+ 'Plugins',
+ grep { $_ ne 'RT::Authen::ExternalAuth' }
+ RT->Config->Get('Plugins')
+ );
+}
RT::Init;
}

0 comments on commit 5ba5190

Please sign in to comment.