[Rt-commit] rt branch, 4.4/external-auth-condition, created. rt-4.4.2-85-g10b3a212e

? sunnavy sunnavy at bestpractical.com
Mon Feb 26 09:49:37 EST 2018


The branch, 4.4/external-auth-condition has been created
        at  10b3a212eff75548c7012312487b9bf0a9b327a2 (commit)

- Log -----------------------------------------------------------------
commit 10b3a212eff75548c7012312487b9bf0a9b327a2
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Feb 26 21:58:43 2018 +0800

    call DoAuth only if ExternalAuthPriority is not empty
    
    There is a case that people might want to use ExternalInfoPriority only,
    so ExternalAuthPriority could be empty while ExternalAuth is true. For
    cases like that, there is no need to bother calling DoAuth at all.
    
    This change is to eliminate the debug log:
    
        ExternalAuthPriority not defined, please check your configuration file.

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index aff0f4801..4f22d106b 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -307,7 +307,7 @@ sub HandleRequest {
 
     # attempt external auth
     $HTML::Mason::Commands::m->comp( '/Elements/DoAuth', %$ARGS )
-        if RT->Config->Get('ExternalAuth');
+        if @{ RT->Config->Get( 'ExternalAuthPriority' ) || [] };
 
     # Process session-related callbacks before any auth attempts
     $HTML::Mason::Commands::m->callback( %$ARGS, CallbackName => 'Session', CallbackPage => '/autohandler' );
@@ -322,7 +322,7 @@ sub HandleRequest {
 
     # attempt external auth
     $HTML::Mason::Commands::m->comp( '/Elements/DoAuth', %$ARGS )
-        if RT->Config->Get('ExternalAuth');
+        if @{ RT->Config->Get( 'ExternalAuthPriority' ) || [] };
 
     # Process per-page authentication callbacks
     $HTML::Mason::Commands::m->callback( %$ARGS, CallbackName => 'Auth', CallbackPage => '/autohandler' );

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


More information about the rt-commit mailing list