[freeside-commits] freeside/FS/FS/TicketSystem RT_Internal.pm, 1.11, 1.12

Ivan,,, ivan at wavetail.420.am
Sat Jan 2 22:24:14 PST 2010


Update of /home/cvs/cvsroot/freeside/FS/FS/TicketSystem
In directory wavetail.420.am:/tmp/cvs-serv1727

Modified Files:
	RT_Internal.pm 
Log Message:
attempt to get more information on errors using an RT-instansiated session??

Index: RT_Internal.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/TicketSystem/RT_Internal.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- RT_Internal.pm	21 Sep 2009 05:35:03 -0000	1.11
+++ RT_Internal.pm	3 Jan 2010 06:24:12 -0000	1.12
@@ -1,7 +1,8 @@
 package FS::TicketSystem::RT_Internal;
 
 use strict;
-use vars qw( @ISA $DEBUG );
+use vars qw( @ISA $DEBUG $me );
+use Data::Dumper;
 use FS::UID qw(dbh);
 use FS::CGI qw(popurl);
 use FS::TicketSystem::RT_Libs;
@@ -9,7 +10,8 @@
 
 @ISA = qw( FS::TicketSystem::RT_Libs );
 
-$DEBUG = 0;
+$DEBUG = 1;
+$me = '[FS::TicketSystem::RT_Internal]';
 
 sub sql_num_customer_tickets {
   "( select count(*) from tickets
@@ -36,15 +38,25 @@
   #return '' unless $conf->config('ticket_system');
   return '' unless FS::Conf->new->config('ticket_system');
 
-  $self->_web_external_auth($session)
-    unless $session
-    && $session->{'CurrentUser'};
+  if ( $session && $session->{'Current_User'} ) {
+    warn "$me access_right: using existing session and CurrentUser: \n".
+         Dumper($session->{'CurrentUser'})
+      if $DEBUG;
+ } else {
+    warn "$me access_right: loading session and CurrentUser\n" if $DEBUG > 1;
+    $self->_web_external_auth($session);
+  }
+
+  #warn "$me access_right: CurrentUser ". $session->{'CurrentUser'}. ":\n".
+  #     ( $DEBUG>1 ? Dumper($session->{'CurrentUser'}) : '' )
+  #  if $DEBUG > 1;
 
   $session->{'CurrentUser'}->HasRight( Right  => $right,
                                        Object => $RT::System );
 }
 
-#shameless false laziness w/rt/html/autohandler to get logged into RT from afar
+#shameless false laziness w/RT::Interface::Web::AttemptExternalAuth
+# to get logged into RT from afar
 sub _web_external_auth {
   my( $self, $session ) = @_;
 
@@ -52,8 +64,8 @@
 
   $session->{'CurrentUser'} = RT::CurrentUser->new();
 
-  warn "loading RT user for $user\n"
-    if $DEBUG;
+  warn "$me _web_external_auth loading RT user for $user\n"
+    if $DEBUG > 1;
 
   $session->{'CurrentUser'}->Load($user);
 



More information about the freeside-commits mailing list