From 9ab2d196a2895e2b07d9bbf939837a3882f6ed9e Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 29 May 2024 04:22:19 +0000 Subject: [PATCH] Fix last_seen (Compare Timestamp instead of seconds after full minute) --- application/models/User_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/User_model.php b/application/models/User_model.php index d10c76c7e..3738dbf77 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -538,7 +538,7 @@ class User_Model extends CI_Model { if(($this->validate_session($u)) && ($u->row()->user_type >= $level) || $this->config->item('use_auth') == FALSE || $level == 0) { $ls=new DateTime($u->row()->last_seen ?? '1971-01-01'); $n=new DateTime("now"); - if ($ls->diff($n)->format('%s') > 60) { // Reduce load of the Spy-Function. shouldn't be called at anytimne. 60seconds diff is enough + if ($n->getTimestamp()-$ls->getTimestamp() > 60) { // Reduce load of the Spy-Function. shouldn't be called at anytimne. 60seconds diff is enough $this->set_last_seen($u->row()->user_id); } return 1;