mark $session->datetime->time as deprecated and remove its use from core code
This commit is contained in:
parent
5ecc986ec6
commit
60a4a9b140
56 changed files with 94 additions and 92 deletions
|
|
@ -950,7 +950,7 @@ sub setToEpoch {
|
|||
}
|
||||
unless ($dt) {
|
||||
$self->session->errorHandler->warn("Could not format date $set for epoch. Returning current time");
|
||||
return $self->time();
|
||||
return $time();
|
||||
}
|
||||
return $dt->epoch;
|
||||
}
|
||||
|
|
@ -959,7 +959,8 @@ sub setToEpoch {
|
|||
|
||||
=head2 time ( )
|
||||
|
||||
Returns an epoch date for now.
|
||||
DEPRECATED - This method is deprecated, and should not be used in new code. Use
|
||||
the perl built in function time().
|
||||
|
||||
=cut
|
||||
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ sub gateway {
|
|||
my $url = $self->session->config->get("gateway").'/'.$pageUrl;
|
||||
$url =~ s/\/+/\//g;
|
||||
if ($self->session->setting->get("preventProxyCache") == 1 and !$skipPreventProxyCache) {
|
||||
$url = $self->append($url,"noCache=".randint(0,1000).':'.$self->session->datetime->time());
|
||||
$url = $self->append($url,"noCache=".randint(0,1000).':'.time());
|
||||
}
|
||||
if ($pairs) {
|
||||
$url = $self->append($url,$pairs);
|
||||
|
|
|
|||
|
|
@ -184,14 +184,14 @@ sub new {
|
|||
$self->session->{_sessionId} = $self->{_var}{sessionId};
|
||||
return $self;
|
||||
}
|
||||
if ($self->{_var}{expires} && $self->{_var}{expires} < $session->datetime->time()) { ##Session expired, start a new one with the same Id
|
||||
if ($self->{_var}{expires} && $self->{_var}{expires} < time()) { ##Session expired, start a new one with the same Id
|
||||
$self->end;
|
||||
$self->start(1,$sessionId);
|
||||
}
|
||||
elsif ($self->{_var}{sessionId} ne "") { ##Fetched an existing session. Update variables with recent data.
|
||||
$self->{_var}{lastPageView} = $session->datetime->time();
|
||||
$self->{_var}{lastPageView} = time();
|
||||
$self->{_var}{lastIP} = $session->env->getIp;
|
||||
$self->{_var}{expires} = $session->datetime->time() + $session->setting->get("sessionTimeout");
|
||||
$self->{_var}{expires} = time() + $session->setting->get("sessionTimeout");
|
||||
$self->session->{_sessionId} = $self->{_var}{sessionId};
|
||||
$session->db->setRow("userSession","sessionId",$self->{_var});
|
||||
return $self;
|
||||
|
|
@ -241,7 +241,7 @@ sub start {
|
|||
$userId = 1 if ($userId eq "");
|
||||
my $sessionId = shift;
|
||||
$sessionId = $self->session->id->generate if ($sessionId eq "");
|
||||
my $time = $self->session->datetime->time();
|
||||
my $time = time();
|
||||
$self->{_var} = {
|
||||
expires => $time + $self->session->setting->get("sessionTimeout"),
|
||||
lastPageView => $time,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue