[Rt-commit] rt branch 4.4/optionally-load-external-auth created. rt-4.4.5-101-g7667be2a46

BPS Git Server git at git.bestpractical.com
Tue May 3 17:07:45 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 4.4/optionally-load-external-auth has been created
        at  7667be2a46213eda9e9602a2b26352c8ed010fc8 (commit)

- Log -----------------------------------------------------------------
commit 7667be2a46213eda9e9602a2b26352c8ed010fc8
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue May 3 23:30:52 2022 +0800

    Optionally load RT::Authen::ExternalAuth in case Net::LDAP is not installed
    
    This is to make sure RT can create users even if Net::LDAP is not
    installed, which is possible as it's not a core dependency.

diff --git a/lib/RT/User.pm b/lib/RT/User.pm
index b4491c7f27..2d4df68975 100644
--- a/lib/RT/User.pm
+++ b/lib/RT/User.pm
@@ -206,8 +206,10 @@ sub Create {
 
     # Add corresponding CustomFieldValue records for custom fields,
     # the same as in RT::Authen::ExternalAuth::UpdateUserInfo.
-    require RT::Authen::ExternalAuth;
-    RT::Authen::ExternalAuth::AddCustomFieldValue(%args);
+    # RT::Authen::ExternalAuth needs Net::LDAP, which might be unavailable
+    if ( RT::Authen::ExternalAuth->require ) {
+        RT::Authen::ExternalAuth::AddCustomFieldValue(%args);
+    }
 
     # Handle any user CFs
     $self->UpdateObjectCustomFieldValues( %args );

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list