Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Exception
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26167/Exception
Modified Files:
Security.pm
Log Message:
some core classes shouldn't use OI2::Context directly since it brings in everything else and has a high likelihood of creating a circular reference
Index: Security.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Exception/Security.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Security.pm 11 Jun 2004 13:01:51 -0000 1.10
--- Security.pm 28 Feb 2005 23:43:44 -0000 1.11
***************
*** 5,9 ****
use strict;
use base qw( OpenInteract2::Exception Class::Accessor::Fast );
- use OpenInteract2::Context qw( CTX );
use SPOPS::Secure qw( :verbose :level );
--- 5,8 ----
***************
*** 14,17 ****
--- 13,18 ----
sub Fields { return @FIELDS }
+ my ( $CTX );
+
my $DEFAULT_MSG = "Security violation. Object requires '%s' but got '%s'";
***************
*** 31,41 ****
? $LEVELS{ $self->security_found }
: 'none specified';
!
my ( $msg );
! if ( CTX && CTX->request ) {
$msg = eval {
! CTX->request
! ->language_handle
! ->maketext( 'global.exception.security', $required, $found );
};
}
--- 32,45 ----
? $LEVELS{ $self->security_found }
: 'none specified';
! unless ( $CTX ) {
! require OpenInteract2::Context;
! $CTX = OpenInteract2::Context->instance;
! }
my ( $msg );
! if ( $CTX && $CTX->request ) {
$msg = eval {
! $CTX->request
! ->language_handle
! ->maketext( 'global.exception.security', $required, $found );
};
}
|