Fixed a bunch of goofs on my part, and made it so it only loads the site's settings, config, env, var, userinfo, and a bunch of other stuff only once per request, instead of a bunch of times per request.

This commit is contained in:
Matthew Wilson 2005-11-26 03:41:12 +00:00
parent 58753a86e9
commit 97bcf1bc16
2 changed files with 32 additions and 19 deletions

View file

@ -75,7 +75,7 @@ sub setupSessionVars {
tie %vars, 'Tie::CPHash';
if ($_[0] ne "") {
%vars = WebGUI::SQL->quickHash("select * from userSession where sessionId=".quote($_[0]));
if ($vars{expires} < time() ) { #|| $vars{lastIP} ne $session{env}{REMOTE_ADDR}) { # had to remove for revolving ip proxies
if (($vars{expires}) && ($vars{expires} < time()) ) { #|| $vars{lastIP} ne $session{env}{REMOTE_ADDR}) { # had to remove for revolving ip proxies
%vars = ();
WebGUI::Session::end($_[0]);
}
@ -275,11 +275,11 @@ Is set to "no" (0) by WebGUI::contentHandler().
sub open {
my $webguiRoot = shift;
my $configFile = shift;
my $instantiateUser = shift || 1;
my $instantiateUser = shift || "true";
###----------------------------
### config variables
$session{config} = WebGUI::Config::getConfig($webguiRoot,$configFile);
$session{config} = WebGUI::Config::getConfig($webguiRoot,$configFile) unless ($configFile eq 'modperl');
###----------------------------
### operating system specific things
@ -312,7 +312,7 @@ sub open {
### global system settings (from settings table)
$session{setting} = WebGUI::Setting::get();
return 1 unless $instantiateUser;
return 1 unless($instantiateUser eq "true");
###----------------------------
### session variables