[Bps-public-commit] rt-extension-ldapimport-multiemail branch, master, updated. 0.03-1-g818c22a

Alex Vandiver alexmv at bestpractical.com
Tue Aug 19 16:37:52 EDT 2014


The branch, master has been updated
       via  818c22a746eadc0d452ad2202e36eb83a29d4b7d (commit)
      from  27c45f66b8172d2d1e21c03a550e90a58031d41a (commit)

Summary of changes:
 lib/RT/Extension/LDAPImport/MultiEmail.pm | 5 +++++
 1 file changed, 5 insertions(+)

- Log -----------------------------------------------------------------
commit 818c22a746eadc0d452ad2202e36eb83a29d4b7d
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Aug 19 16:36:30 2014 -0400

    Even if LDAPUpdateOnly is set, new aliases should be created
    
    LDAPUpdateOnly normally prevents the creation of new users in
    _import_user; however, in the case of importing secondary email address,
    while a "user" is created, it is functionally only created to be an
    update on an existing user.  As such, allow the user to created.

diff --git a/lib/RT/Extension/LDAPImport/MultiEmail.pm b/lib/RT/Extension/LDAPImport/MultiEmail.pm
index 73a2db4..21b8e8e 100644
--- a/lib/RT/Extension/LDAPImport/MultiEmail.pm
+++ b/lib/RT/Extension/LDAPImport/MultiEmail.pm
@@ -73,6 +73,11 @@ sub _import_user {
         $ldap->replace( mail => $address );
         $ldap->replace( $_ => [] ) for @{$secondary_attrs};
 
+        # Even if we were told to "only update", we should be able to
+        # create aliases to merge in.
+        local $RT::LDAPUpdateUsers = $RT::LDAPUpdateOnly;
+        local $RT::LDAPUpdateOnly  = 0;
+
         # Build and import the secondary user
         my $data = $self->_build_user_object( ldap_entry => $ldap );
         $alt = $self->_import_user(

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


More information about the Bps-public-commit mailing list