summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2010-01-03 06:24:12 +0000
committerivan <ivan>2010-01-03 06:24:12 +0000
commitefe2a7b5bf12564bed66c1c713f445effe3513a3 (patch)
tree8accdb3bf3b0dfc9bfb2414cc1dbc58753643421 /FS
parent8d6987f81d3d5667b00b428580a05e7ac973279a (diff)
attempt to get more information on errors using an RT-instansiated session??
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/TicketSystem/RT_Internal.pm28
1 files changed, 20 insertions, 8 deletions
diff --git a/FS/FS/TicketSystem/RT_Internal.pm b/FS/FS/TicketSystem/RT_Internal.pm
index 033c746ba..85b2d56dd 100644
--- a/FS/FS/TicketSystem/RT_Internal.pm
+++ b/FS/FS/TicketSystem/RT_Internal.pm
@@ -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 @@ use RT::CurrentUser;
@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 @@ sub access_right {
#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 @@ sub _web_external_auth {
$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);