[Rt-devel] Couple of fixes to User_Overlay, error conditions

Brian D bjd-dev at simplicity.net
Mon Dec 21 17:19:44 EST 2009


While getting a 3.8.6 instance fired up recently, I noticed a couple of bugs
in User_Overlay while using RT::Authen::ExternalAuth.  Most of this is
applicable to 3.8.7, although the fixed warning message with ? : was fixed
in a different way.

Now these issues shouldn't generally manifest themselves, but when the do,
this additional debugging so it doesn't crash badly does help.

-Brian

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

+++ rt-3.8.6/lib/RT/User_Overlay.pm     2009-12-21 20:48:27.000000000 +0000
@@ -116,6 +116,8 @@
         @_    # get the real argumentlist
     );

+    $RT::Logger->warning( "Create called", join(',',%args));
+
     # remove the value so it does not cripple SUPER::Create
     my $record_transaction = delete $args{'_RecordTransaction'};

@@ -1018,6 +1020,13 @@
         return (undef);
     }

+    unless ( defined $self->PrincipalObj ) {
+        $RT::Logger->info(
+            "INTERNAL ERROR: IN IsPassword without a valid PrincipalObj
when user " . $self->Name . " tried to log in" );
+        return (undef);
+    }
+
+
    if ( $self->PrincipalObj->Disabled ) {
         $RT::Logger->info(
             "Disabled user " . $self->Name . " tried to log in" );
@@ -1140,10 +1149,10 @@
     my $set_err = $self->PrincipalObj->SetDisabled($val);
     unless ($set_err) {
         $RT::Handle->Rollback();
-        $RT::Logger->warning("Couldn't ".($val == 1) ? "disable" :
"enable"." user ".$self->PrincipalObj->Id);
+        $RT::Logger->warning("Couldn't ".(($val == 1) ? "disable" :
"enable")." user ".$self->PrincipalObj->Id);
         return (undef);
     }
-    $self->_NewTransaction( Type => ($val == 1) ? "Disabled" : "Enabled" );
+    $self->_NewTransaction( Type => (($val == 1) ? "Disabled" : "Enabled")
);

     $RT::Handle->Commit();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/rt-devel/attachments/20091221/cbadd75a/attachment.htm 


More information about the Rt-devel mailing list