Preparing for the 4.9.3 release.
This commit is contained in:
parent
600583789b
commit
d026717c71
2 changed files with 1074 additions and 737 deletions
1780
docs/create.sql
1780
docs/create.sql
File diff suppressed because one or more lines are too long
|
|
@ -75,13 +75,6 @@ tie %session, 'Tie::CPHash';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
sub _generateSessionId {
|
|
||||||
my ($sessionId);
|
|
||||||
$sessionId = crypt((time()*rand(1000)),rand(99));
|
|
||||||
return $sessionId;
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub _setupPageInfo {
|
sub _setupPageInfo {
|
||||||
my (%page, $pageId, $pageName);
|
my (%page, $pageId, $pageName);
|
||||||
|
|
@ -126,9 +119,9 @@ sub _setupSessionVars {
|
||||||
$session{scratch} = WebGUI::SQL->buildHashRef("select name,value from userSessionScratch
|
$session{scratch} = WebGUI::SQL->buildHashRef("select name,value from userSessionScratch
|
||||||
where sessionId=".quote($_[0]));
|
where sessionId=".quote($_[0]));
|
||||||
WebGUI::SQL->write("update userSession set lastPageView=".time().", lastIP='$ENV{REMOTE_ADDR}',
|
WebGUI::SQL->write("update userSession set lastPageView=".time().", lastIP='$ENV{REMOTE_ADDR}',
|
||||||
expires=".(time()+$_[1])." where sessionId='$_[0]'");
|
expires=".(time()+$session{setting}{sessionTimeout})." where sessionId='$_[0]'");
|
||||||
} else {
|
} else {
|
||||||
setCookie("wgSession",$session{cookie}{wgSession},"-10y");
|
start(1,$session{$_[0]});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$session{var} = \%vars;
|
$session{var} = \%vars;
|
||||||
|
|
@ -446,7 +439,7 @@ sub open {
|
||||||
if ($session{cookie}{wgSession} eq "") {
|
if ($session{cookie}{wgSession} eq "") {
|
||||||
start(1); #setting up a visitor session
|
start(1); #setting up a visitor session
|
||||||
} else {
|
} else {
|
||||||
_setupSessionVars($session{cookie}{wgSession},$session{setting}{sessionTimeout});
|
_setupSessionVars($session{cookie}{wgSession});
|
||||||
}
|
}
|
||||||
###----------------------------
|
###----------------------------
|
||||||
### current page's properties (from page table)
|
### current page's properties (from page table)
|
||||||
|
|
@ -502,7 +495,7 @@ sub refreshPageInfo {
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub refreshSessionVars {
|
sub refreshSessionVars {
|
||||||
_setupSessionVars($_[0],$session{setting}{sessionTimeout});
|
_setupSessionVars($_[0]);
|
||||||
refreshUserInfo($session{var}{userId});
|
refreshUserInfo($session{var}{userId});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -598,24 +591,24 @@ sub setScratch {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 start ( userId )
|
=head2 start ( userId [ , sessionId ] )
|
||||||
|
|
||||||
Start a new user session.
|
Start a new user session.
|
||||||
|
|
||||||
=item
|
=item userId
|
||||||
|
|
||||||
The user id of the user to create a session for.
|
The user id of the user to create a session for.
|
||||||
|
|
||||||
|
=item sessionId
|
||||||
|
|
||||||
|
Session id will be generated if not specified. In almost every case
|
||||||
|
you should let the system generate the session id.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub start {
|
sub start {
|
||||||
my ($sessionId);
|
my ($sessionId);
|
||||||
if ($session{cookie}{wgSession} ne "") { #fix for internet exploder cookie bug
|
$sessionId = $_[1] || crypt((time()*rand(1000)),rand(99));
|
||||||
$sessionId = $session{cookie}{wgSession};
|
|
||||||
end($sessionId);
|
|
||||||
} else {
|
|
||||||
$sessionId = _generateSessionId();
|
|
||||||
}
|
|
||||||
WebGUI::SQL->write("insert into userSession values ('$sessionId', ".
|
WebGUI::SQL->write("insert into userSession values ('$sessionId', ".
|
||||||
(time()+$session{setting}{sessionTimeout}).", ".time().", 0, '$ENV{REMOTE_ADDR}', $_[0])");
|
(time()+$session{setting}{sessionTimeout}).", ".time().", 0, '$ENV{REMOTE_ADDR}', $_[0])");
|
||||||
setCookie("wgSession",$sessionId);
|
setCookie("wgSession",$sessionId);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue