Change o_timeout_visit
This commit is contained in:
parent
f934dca667
commit
e6ecc16327
6 changed files with 22 additions and 8 deletions
|
@ -171,7 +171,7 @@ class Cookie extends Model
|
|||
$expire = $expTime;
|
||||
$pfx = '';
|
||||
} else {
|
||||
$expTime = \time() + $this->c->config->o_timeout_visit;
|
||||
$expTime = \time() + $this->c->config->i_timeout_visit;
|
||||
$expire = 0;
|
||||
$pfx = '-';
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class Online extends Model
|
|||
$all = 0;
|
||||
$now = \time();
|
||||
$tOnline = $now - $this->c->config->o_timeout_online;
|
||||
$tVisit = $now - $this->c->config->o_timeout_visit;
|
||||
$tVisit = $now - $this->c->config->i_timeout_visit;
|
||||
$users = [];
|
||||
$guests = [];
|
||||
$bots = [];
|
||||
|
|
|
@ -1204,7 +1204,7 @@ class Install extends Admin
|
|||
'o_board_title' => $v->title,
|
||||
'o_board_desc' => $v->descr,
|
||||
'o_default_timezone' => 0,
|
||||
'o_timeout_visit' => 3600,
|
||||
'i_timeout_visit' => 3600,
|
||||
'o_timeout_online' => 900,
|
||||
'o_redirect_delay' => 1,
|
||||
'o_show_user_info' => 1,
|
||||
|
|
|
@ -43,7 +43,7 @@ class Options extends Admin
|
|||
'o_default_dst' => 'required|integer|in:0,1',
|
||||
'o_default_lang' => 'required|string:trim|in:' . \implode(',', $this->c->Func->getLangs()),
|
||||
'o_default_style' => 'required|string:trim|in:' . \implode(',', $this->c->Func->getStyles()),
|
||||
'o_timeout_visit' => 'required|integer|min:0|max:99999',
|
||||
'i_timeout_visit' => 'required|integer|min:0|max:99999',
|
||||
'o_timeout_online' => 'required|integer|min:0|max:99999|check_timeout',
|
||||
'o_redirect_delay' => 'required|integer|min:0|max:99999',
|
||||
'o_show_user_info' => 'required|integer|in:0,1',
|
||||
|
@ -140,7 +140,7 @@ class Options extends Admin
|
|||
*/
|
||||
public function vCheckTimeout(Validator $v, $timeout)
|
||||
{
|
||||
if ($timeout >= $v->o_timeout_visit) {
|
||||
if ($timeout >= $v->i_timeout_visit) {
|
||||
$v->addError('Timeout error message');
|
||||
}
|
||||
|
||||
|
@ -296,11 +296,11 @@ class Options extends Admin
|
|||
$form['sets']['timeouts'] = [
|
||||
'legend' => 'Timeouts subhead',
|
||||
'fields' => [
|
||||
'o_timeout_visit' => [
|
||||
'i_timeout_visit' => [
|
||||
'type' => 'number',
|
||||
'min' => '0',
|
||||
'max' => '99999',
|
||||
'value' => $config->o_timeout_visit,
|
||||
'value' => $config->i_timeout_visit,
|
||||
'caption' => 'Visit timeout label',
|
||||
'help' => 'Visit timeout help',
|
||||
],
|
||||
|
|
|
@ -492,4 +492,18 @@ class Update extends Admin
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* rev.43 to rev.44
|
||||
*/
|
||||
protected function stageNumber43(array $args): ?int
|
||||
{
|
||||
$this->c->config->i_timeout_visit = $this->c->config->o_timeout_visit ?? 3600;
|
||||
|
||||
unset($this->c->config->o_timeout_visit);
|
||||
|
||||
$this->c->config->save();
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ class Current extends Action
|
|||
// Special case: We've timed out, but no other user has browsed the forums since we timed out
|
||||
if (
|
||||
$user->logged > 0
|
||||
&& $user->logged < \time() - $this->c->config->o_timeout_visit
|
||||
&& $user->logged < \time() - $this->c->config->i_timeout_visit
|
||||
) {
|
||||
$this->manager->updateLastVisit($user);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue