weaken all session refs
This commit is contained in:
parent
387942e68d
commit
cc87552a22
20 changed files with 90 additions and 19 deletions
|
|
@ -19,6 +19,7 @@ use DateTime;
|
|||
use DateTime::Format::Strptime;
|
||||
use DateTime::Format::Mail;
|
||||
use DateTime::TimeZone;
|
||||
use Scalar::Util qw( weaken );
|
||||
use Tie::IxHash;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Utility;
|
||||
|
|
@ -808,7 +809,9 @@ A reference to the current session.
|
|||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
bless {_session=>$session}, $class;
|
||||
my $self = bless {_session=>$session}, $class;
|
||||
weaken( $self->{_session} );
|
||||
return $self;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ package WebGUI::Session::ErrorHandler;
|
|||
|
||||
use strict;
|
||||
use Log::Log4perl;
|
||||
use Scalar::Util qw( weaken );
|
||||
#use Apache2::RequestUtil;
|
||||
use JSON;
|
||||
use HTML::Entities qw(encode_entities);
|
||||
|
|
@ -161,6 +162,7 @@ The message you wish to add to the log.
|
|||
|
||||
sub debug {
|
||||
my $self = shift;
|
||||
return unless $self->canShowDebug || $self->getLogger->is_debug;
|
||||
my $message = shift;
|
||||
local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1;
|
||||
$self->getLogger->debug($message);
|
||||
|
|
@ -197,6 +199,7 @@ The message you wish to add to the log.
|
|||
|
||||
sub error {
|
||||
my $self = shift;
|
||||
return unless $self->canShowDebug || $self->getLogger->is_error;
|
||||
my $message = shift;
|
||||
local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1;
|
||||
$self->getLogger->error($message);
|
||||
|
|
@ -303,6 +306,7 @@ The message you wish to add to the log.
|
|||
|
||||
sub info {
|
||||
my $self = shift;
|
||||
return unless $self->canShowDebug || $self->getLogger->is_info;
|
||||
my $message = shift;
|
||||
local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1;
|
||||
$self->getLogger->info($message);
|
||||
|
|
@ -326,7 +330,9 @@ sub new {
|
|||
my $session = shift;
|
||||
Log::Log4perl->init_once( $session->config->getWebguiRoot."/etc/log.conf" );
|
||||
my $logger = Log::Log4perl->get_logger($session->config->getFilename);
|
||||
bless {_queryCount=>0, _logger=>$logger, _session=>$session}, $class;
|
||||
my $self = bless {_queryCount=>0, _logger=>$logger, _session=>$session}, $class;
|
||||
weaken( $self->{_session} );
|
||||
return $self;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -471,6 +477,7 @@ The message you wish to add to the log.
|
|||
|
||||
sub warn {
|
||||
my $self = shift;
|
||||
return unless $self->canShowDebug || $self->getLogger->is_warn;
|
||||
my $message = shift;
|
||||
local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1;
|
||||
$self->getLogger->warn($message);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ package WebGUI::Session::Http;
|
|||
|
||||
use strict;
|
||||
use WebGUI::Utility;
|
||||
use Scalar::Util qw( weaken );
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -267,7 +268,9 @@ A reference to the current session.
|
|||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
bless {_session=>$session}, $class;
|
||||
my $self = bless {_session=>$session}, $class;
|
||||
weaken( $self->{_session} );
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ package WebGUI::Session::Icon;
|
|||
|
||||
use strict;
|
||||
use WebGUI::International;
|
||||
use Scalar::Util qw( weaken );
|
||||
|
||||
|
||||
=head1 NAME
|
||||
|
|
@ -510,7 +511,9 @@ A reference to the current session.
|
|||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
bless {_session=>$session}, $class;
|
||||
my $self = bless {_session=>$session}, $class;
|
||||
weaken( $self->{_session} );
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ package WebGUI::Session::Id;
|
|||
|
||||
use strict;
|
||||
use Digest::MD5;
|
||||
use Scalar::Util qw( weaken );
|
||||
use Time::HiRes qw( gettimeofday usleep );
|
||||
use MIME::Base64;
|
||||
|
||||
|
|
@ -121,7 +122,9 @@ A reference to the current session.
|
|||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
bless {_session=>$session}, $class;
|
||||
my $self = bless {_session=>$session}, $class;
|
||||
weaken( $self->{_session} );
|
||||
return $self;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ package WebGUI::Session::Output;
|
|||
|
||||
use strict;
|
||||
use WebGUI::Macro;
|
||||
use Scalar::Util qw( weaken );
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -65,7 +66,9 @@ A reference to the current session.
|
|||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
bless {_session=>$session}, $class;
|
||||
my $self = bless {_session=>$session}, $class;
|
||||
weaken( $self->{_session} );
|
||||
return $self;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ package WebGUI::Session::Privilege;
|
|||
=cut
|
||||
|
||||
use strict;
|
||||
use Scalar::Util qw( weaken );
|
||||
use WebGUI::International;
|
||||
use WebGUI::Operation::Auth;
|
||||
|
||||
|
|
@ -145,7 +146,9 @@ A reference to the current session.
|
|||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
bless {_session=>$session}, $class;
|
||||
my $self = bless {_session=>$session}, $class;
|
||||
weaken( $self->{_session} );
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ package WebGUI::Session::Scratch;
|
|||
|
||||
use strict;
|
||||
use WebGUI::International;
|
||||
use Scalar::Util qw( weaken );
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -191,7 +192,9 @@ sub new {
|
|||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $data = $session->db->buildHashRef("select name,value from userSessionScratch where sessionId=?",[$session->getId], {noOrder => 1});
|
||||
bless {_session=>$session, _data=>$data}, $class;
|
||||
my $self = bless {_session=>$session, _data=>$data}, $class;
|
||||
weaken( $self->{_session} );
|
||||
return $self;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ package WebGUI::Session::Setting;
|
|||
=cut
|
||||
|
||||
use strict;
|
||||
use Scalar::Util qw( weaken );
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -146,7 +147,9 @@ sub new {
|
|||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $settings = $session->db->buildHashRef("select * from settings", [], {noOrder => 1});
|
||||
bless {_settings=>$settings, _session=>$session}, $class;
|
||||
my $self = bless {_settings=>$settings, _session=>$session}, $class;
|
||||
weaken( $self->{_session} );
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ package WebGUI::Session::Stow;
|
|||
=cut
|
||||
|
||||
use strict;
|
||||
use Scalar::Util qw( weaken );
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -156,7 +157,9 @@ A reference to the session.
|
|||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
bless {_session=>$session}, $class;
|
||||
my $self = bless {_session=>$session}, $class;
|
||||
weaken( $self->{_session} );
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ package WebGUI::Session::Style;
|
|||
|
||||
use strict;
|
||||
use Tie::CPHash;
|
||||
use Scalar::Util qw( weaken );
|
||||
use WebGUI::International;
|
||||
use WebGUI::Macro;
|
||||
use WebGUI::Asset::Template;
|
||||
|
|
@ -181,7 +182,9 @@ A reference to the current session.
|
|||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
bless {_session=>$session}, $class;
|
||||
my $self = bless {_session=>$session}, $class;
|
||||
weaken( $self->{_session} );
|
||||
return $self;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package WebGUI::Session::Url;
|
|||
use strict;
|
||||
use URI;
|
||||
use URI::Escape;
|
||||
use Scalar::Util qw( weaken );
|
||||
use WebGUI::International;
|
||||
use WebGUI::Utility;
|
||||
|
||||
|
|
@ -425,7 +426,9 @@ A reference to the current session.
|
|||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
bless {_session=>$session}, $class;
|
||||
my $self = bless {_session=>$session}, $class;
|
||||
weaken( $self->{_session} );
|
||||
return $self;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ package WebGUI::Session::Var;
|
|||
=cut
|
||||
|
||||
use strict;
|
||||
use Scalar::Util qw( weaken );
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -171,6 +172,7 @@ sub new {
|
|||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $self = bless {_session=>$session}, $class;
|
||||
weaken( $self->{_session} );
|
||||
my $sessionId = shift;
|
||||
my $noFuss = shift;
|
||||
if ($sessionId eq "") { ##New session
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue