aboutsummaryrefslogtreecommitdiff
path: root/app/class/Controller.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-05-25 17:05:08 +0200
committervincent-peugnet <v.peugnet@free.fr>2020-05-25 17:05:08 +0200
commit55fc826f9827dd86427534c11594c0d9c4f0b8d1 (patch)
tree173075f643de38d6ac79dc86cd4b1099f99a3eaf /app/class/Controller.php
parentbab3d969f6ab1846d818e4ef4d4f777c13575d88 (diff)
downloadwcms-55fc826f9827dd86427534c11594c0d9c4f0b8d1.tar.gz
wcms-55fc826f9827dd86427534c11594c0d9c4f0b8d1.zip
add /login and /logout close #117
Diffstat (limited to 'app/class/Controller.php')
-rw-r--r--app/class/Controller.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/class/Controller.php b/app/class/Controller.php
index c631726..2b38988 100644
--- a/app/class/Controller.php
+++ b/app/class/Controller.php
@@ -161,4 +161,16 @@ class Controller
Model::sendflashmessage($count . ' / ' . $total . ' ' . $message, 'error');
}
}
+
+ /**
+ * Destroy session and cookie token in user database
+ */
+ public function disconnect()
+ {
+ $this->session->addtosession('user', '');
+ $this->user->destroysession($this->session->wsession);
+ $this->session->addtosession('wsession', '');
+ $this->usermanager->add($this->user);
+
+ }
}