[Rt-commit] r5400 - rt/branches/3.4-RELEASE/lib/RT/Interface

ruz at bestpractical.com ruz at bestpractical.com
Fri Jun 16 20:40:25 EDT 2006


Author: ruz
Date: Fri Jun 16 20:40:24 2006
New Revision: 5400

Modified:
   rt/branches/3.4-RELEASE/lib/RT/Interface/Email.pm

Log:
* not default mail plugins has been broken during last refactoring
** move a code back into its scope
** don't forget to store $_ in $Class when $_ matches ^RT::Interface::Email

Modified: rt/branches/3.4-RELEASE/lib/RT/Interface/Email.pm
==============================================================================
--- rt/branches/3.4-RELEASE/lib/RT/Interface/Email.pm	(original)
+++ rt/branches/3.4-RELEASE/lib/RT/Interface/Email.pm	Fri Jun 16 20:40:24 2006
@@ -588,11 +588,11 @@
         return ( -75, "RT couldn't find the queue: " . $args{'queue'}, undef );
     }
 
-   # Authentication Level ($AuthStat)
-   # -1 - Get out.  this user has been explicitly declined
-   # 0 - User may not do anything (Not used at the moment)
-   # 1 - Normal user
-   # 2 - User is allowed to specify status updates etc. a la enhanced-mailgate
+    # Authentication Level ($AuthStat)
+    # -1 - Get out.  this user has been explicitly declined
+    # 0 - User may not do anything (Not used at the moment)
+    # 1 - Normal user
+    # 2 - User is allowed to specify status updates etc. a la enhanced-mailgate
     my ( $CurrentUser, $AuthStat, $error );
 
     # Initalize AuthStat so comparisons work correctly
@@ -606,21 +606,22 @@
 
     # Since this needs loading, no matter what
     foreach (@RT::MailPlugins) {
-        my ($Code, $Class, $NewAuthStat);
+        my ($Code, $NewAuthStat);
         if ( ref($_) eq "CODE" ) {
             $Code = $_;
         } else {
-            $Class = "RT::Interface::Email::" . $_
-                unless $_ =~ /^RT::Interface::Email::/;
+            my $Class = $_;
+            $Class = "RT::Interface::Email::" . $Class
+                unless $Class =~ /^RT::Interface::Email::/;
             $Class->require or
                 do { $RT::Logger->error("Couldn't load $Class: $@"); next };
-        }
+
             no strict 'refs';
-            if ( !defined( $Code = *{ $Class . "::GetCurrentUser" }{CODE} ) ) {
-                $RT::Logger->crit( "No GetCurrentUser code found in $Class module");
+            unless ( defined( $Code = *{ $Class . "::GetCurrentUser" }{CODE} ) ) {
+                $RT::Logger->crit( "No 'GetCurrentUser' function found in '$Class' module");
                 next;
             }
-        
+        }
 
         foreach my $action (@actions) {
             ( $CurrentUser, $NewAuthStat ) = $Code->(


More information about the Rt-commit mailing list