[Bps-public-commit] RT-Extension-LDAPImport branch, master, updated. 0.32_06-1-g5ba5190

Thomas Sibley trs at bestpractical.com
Tue Jul 3 17:30:09 EDT 2012


The branch, master has been updated
       via  5ba51906d4d86670fa5c8102a0928dc9886e80c0 (commit)
      from  90716a1714301f35d843d6723a4739ffd02d8c8b (commit)

Summary of changes:
 bin/rtldapimport.in | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 5ba51906d4d86670fa5c8102a0928dc9886e80c0
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Jul 3 14:22:10 2012 -0700

    Actually disable RT::Authen::ExternalAuth while importing users from LDAP
    
    The original code from 56d0d416 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.

diff --git a/bin/rtldapimport.in b/bin/rtldapimport.in
index 3222d7d..ef27f60 100755
--- a/bin/rtldapimport.in
+++ b/bin/rtldapimport.in
@@ -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
- at 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;
 }

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list