diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-02-26 15:01:12 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-02-26 15:01:12 +0000 |
| commit | ad98d39d4d97272b7762bc818bb46dec6272d006 (patch) | |
| tree | 0dfd306bde61c7fab90b1ae66256d5bc4c2df221 /index.php | |
| parent | 269fd10d8b81cb5e33a7a34320b7f88f5aec76eb (diff) | |
| download | webtrees-ad98d39d4d97272b7762bc818bb46dec6272d006.tar.gz webtrees-ad98d39d4d97272b7762bc818bb46dec6272d006.tar.bz2 webtrees-ad98d39d4d97272b7762bc818bb46dec6272d006.zip | |
Remove global constant WT_TIMESTAMP
Diffstat (limited to 'index.php')
| -rw-r--r-- | index.php | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -157,14 +157,15 @@ if ($max_execution_time !== '' && strpos(ini_get('disable_functions'), 'set_time // Sessions Session::start(); -define('WT_TIMESTAMP', Carbon::now('UTC')->timestamp); +// Update the last-login time no more than once a minute. +$next_session_update = Carbon::createFromTimestamp((int) Session::get('session_time_updates'))->addMinute(); +if ($next_session_update < Carbon::now()) { + $timestamp_now = Carbon::now()->timestamp; -// Update the last-login time no more than once a minute -if (WT_TIMESTAMP - Session::get('activity_time') >= 60) { if (Session::get('masquerade') === null) { - Auth::user()->setPreference('sessiontime', (string) WT_TIMESTAMP); + Auth::user()->setPreference('sessiontime', (string) $timestamp_now); } - Session::put('activity_time', WT_TIMESTAMP); + Session::put('session_time_updates', $timestamp_now); } DebugBar::startMeasure('routing'); |
