[Bps-public-commit] r10893 - RT-BugTracker-Public/html/Callbacks/BugTracker-Public/autohandler

ruz at bestpractical.com ruz at bestpractical.com
Wed Feb 20 06:39:04 EST 2008


Author: ruz
Date: Wed Feb 20 06:39:03 2008
New Revision: 10893

Modified:
   RT-BugTracker-Public/html/Callbacks/BugTracker-Public/autohandler/Auth

Log:
* check that public user exists before setting $session{'CurrentUser'}
* log an error when couldn't laod public user

Modified: RT-BugTracker-Public/html/Callbacks/BugTracker-Public/autohandler/Auth
==============================================================================
--- RT-BugTracker-Public/html/Callbacks/BugTracker-Public/autohandler/Auth	(original)
+++ RT-BugTracker-Public/html/Callbacks/BugTracker-Public/autohandler/Auth	Wed Feb 20 06:39:03 2008
@@ -54,8 +54,13 @@
     and not defined $ARGS{pass} )
 {
     if ( $m->request_comp->path =~ m{ ^/+Public/ }x ) {
-        $session{'CurrentUser'} = RT::CurrentUser->new();
-        $session{'CurrentUser'}->LoadByName($RT::WebPublicUser);
+        my $cu = new RT::CurrentUser;
+        $cu->LoadByName( $RT::WebPublicUser );
+        unless ( $cu->id ) {
+            $RT::Logger->error("Couldn't load public user with name '$RT::WebPublicUser'");
+        } else {
+            $session{'CurrentUser'} = $cu;
+        }
     }
     elsif ( $m->request_comp->path =~ '^(/+)Ticket/Display.html'
                 and $ARGS{'id'} )



More information about the Bps-public-commit mailing list