The software allows for the easy importation of users from an LDAP store, streamlining the user onboarding process for a more efficient and effective experience.
The run_search method of the RT::Extension::LDAPImport executes a search using the RT::LDAPFilter and RT::LDAPBase options, restricting the users coming back. This method relies on the connect_ldap method to establish a connection with the LDAP server. Results of the search from run_search are then imported by the import_users method, which maps attributes from LDAP into RT::User attributes using $RT::LDAPMapping.
To use RT::LDAPMapping, users are required to set the RTUserField and LDAPField variables in the RT_SiteConfig file. RTUserField is the name of a field on the RT::User object, and LDAPField can be a simple scalar that looks up a specific attribute in LDAP. If it is an arrayref, it will be evaluated in turn, and scalars will be looked up in LDAP and concatenated together with a single space. It can also be a sub-reference, which will execute and return a scalar value or an arrayref.
RT::Extension::LDAPImport has an internal helper function, _check_ldap_mapping, which returns true if there is an LDAPMapping configured; otherwise, it logs an error and disconnects from the LDAP server.
_build_user is another internal helper function of RT::Extension::LDAPImport that builds up user data from LDAP for importing. It returns a hash of user data ready for RT::User::Create. _parse_ldap_map is another internal helper function that supports import_user.
create_rt_user is a method of this software that takes a hashref of args to pass to RT::User::Create, and if the $LDAPUpdateUsers variable is true, the data in RT will be overwritten with data from LDAP. Otherwise, the software will skip to the next user. RT::Extension::LDAPImport's add_user_to_group method adds new users to the group specified in the $LDAPGroupName variable, which defaults to 'Imported from LDAP.' In case the specified custom field does not exist, the add_custom_field_value method will throw an error and import no data.
Finally, RT::Extension::LDAPImport's setup_group method pulls the $LDAPGroupName object out of the DB or creates it if one does not exist. Users can use the disconnect_ldap method to disconnect from the LDAP server.
Version 0.07: N/A