aboutsummaryrefslogtreecommitdiff
path: root/app/class/controllerconnect.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2019-08-09 02:56:29 +0200
committervincent-peugnet <v.peugnet@free.fr>2019-08-09 02:56:29 +0200
commit49f827b172dd3c07e3c4562a261557feb1ef03f6 (patch)
treec24e1ff26ccfcd4451de660e5307353b5d787b02 /app/class/controllerconnect.php
parent87ca0b50e624feacd2caff2057c5ebfb62a7977f (diff)
downloadwcms-49f827b172dd3c07e3c4562a261557feb1ef03f6.tar.gz
wcms-49f827b172dd3c07e3c4562a261557feb1ef03f6.zip
Feature : Users may expire
- user have expiredate - admins can set up this date
Diffstat (limited to 'app/class/controllerconnect.php')
-rw-r--r--app/class/controllerconnect.php12
1 files changed, 7 insertions, 5 deletions
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) {