[Bps-public-commit] RT-Extension-CommandByMail branch, master, updated. 0.09-2-g2f614e4

Kevin Falcone falcone at bestpractical.com
Wed Aug 3 11:27:01 EDT 2011


The branch, master has been updated
       via  2f614e46d1d2d892873410c50c8ca79828b304b6 (commit)
      from  01320e4fa99800e17a4956049f8948994ec28bfc (commit)

Summary of changes:
 lib/RT/Interface/Email/Filter/TakeAction.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 2f614e46d1d2d892873410c50c8ca79828b304b6
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Tue Aug 2 17:00:35 2011 -0400

    When user creation is blocked, we get a defined CurrentUser
    
    RT-Authen-ExternalAuth can block user creation in the mailgate by
    returning 0 from CanonicalizeUserInfo if the user doesn't exist in the
    external system.  RT blindly assumes that
    RT::Interface::Email::CreateUser will return a user, so it returns the
    CurrentUser and 1 without checking to see if the creation was
    successful.
    
    This results in CommandByMail getting a defined but unloaded CurrentUser
    
    Checking for the Id prevents later failures

diff --git a/lib/RT/Interface/Email/Filter/TakeAction.pm b/lib/RT/Interface/Email/Filter/TakeAction.pm
index 46823aa..7e4030e 100644
--- a/lib/RT/Interface/Email/Filter/TakeAction.pm
+++ b/lib/RT/Interface/Email/Filter/TakeAction.pm
@@ -148,7 +148,7 @@ sub GetCurrentUser {
         @_
     );
 
-    unless ( $args{'CurrentUser'} ) {
+    unless ( $args{'CurrentUser'} && $args{'CurrentUser'}->Id ) {
         $RT::Logger->error(
             "Filter::TakeAction executed when "
             ."CurrentUser (actor) is not authorized. "

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



More information about the Bps-public-commit mailing list