From 49f827b172dd3c07e3c4562a261557feb1ef03f6 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Fri, 9 Aug 2019 02:56:29 +0200 Subject: Feature : Users may expire - user have expiredate - admins can set up this date --- app/class/controllerconnect.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'app/class/controllerconnect.php') diff --git a/app/class/controllerconnect.php b/app/class/controllerconnect.php index 303abf2..bf1b72d 100644 --- a/app/class/controllerconnect.php +++ b/app/class/controllerconnect.php @@ -37,11 +37,13 @@ class Controllerconnect extends Controller if (isset($_POST['pass'])) { $this->user = $this->usermanager->passwordcheck($_POST['pass']); if($this->user != false) { - $this->usermanager->connectcounter($this->user); - $this->usermanager->writesession($this->user); - $_SESSION['workspace']['showleftpanel'] = true; - $_SESSION['workspace']['showrightpanel'] = false; - + if($this->user->expiredate() === false || $this->user->level() === 10 || $this->user->expiredate('date') > $this->now) { + $this->user->connectcounter(); + $this->usermanager->add($this->user); + $this->usermanager->writesession($this->user); + $_SESSION['workspace']['showleftpanel'] = true; + $_SESSION['workspace']['showrightpanel'] = false; + } } } if ($id !== null) { -- cgit v1.2.3