From 87ca0b50e624feacd2caff2057c5ebfb62a7977f Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Fri, 9 Aug 2019 00:17:08 +0200 Subject: Users have now a connections counter --- app/class/user.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'app/class/user.php') diff --git a/app/class/user.php b/app/class/user.php index 645f73e..7a05f7b 100644 --- a/app/class/user.php +++ b/app/class/user.php @@ -9,6 +9,7 @@ class User protected $passwordhashed = false; protected $cookie = 0; protected $columns = ['title', 'datemodif', 'datecreation', 'secure', 'visitcount']; + protected $connectcount = 0; public function __construct($datas = []) { @@ -79,6 +80,11 @@ class User return $this->columns; } + public function connectcount() + { + return $this->connectcount; + } + // _______________________ S E T _______________________ @@ -135,6 +141,19 @@ class User } } + public function setconnectcount($connectcount) + { + if(is_int($connectcount) && $connectcount >= 0) { + $this->connectcount = $connectcount; + } + } + + + + + + //____________________________________________________ F U N ____________________________________________________ + @@ -183,6 +202,13 @@ class User { return $this->level === Modeluser::ADMIN; } + + + public function connectcounter() + { + $this->connectcount ++; + } + } -- cgit v1.2.3