summaryrefslogtreecommitdiff
path: root/app/frontend/user/AuthManager.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-10-25 18:59:39 +0200
committeremkael <emkael@tlen.pl>2016-10-25 18:59:39 +0200
commitf337e63ef70f5f3210577e494e04acf642570ef9 (patch)
treeba2ca57c5bc3606f017e7a3b05d7b176bcd0bad7 /app/frontend/user/AuthManager.php
parent7f15fb107344f5e876df6f053004415ea1759c70 (diff)
* clearing saved user auth key on logout
Diffstat (limited to 'app/frontend/user/AuthManager.php')
-rw-r--r--app/frontend/user/AuthManager.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/frontend/user/AuthManager.php b/app/frontend/user/AuthManager.php
new file mode 100644
index 0000000..54f92e4
--- /dev/null
+++ b/app/frontend/user/AuthManager.php
@@ -0,0 +1,22 @@
+<?php
+
+Prado::using('System.Security.TAuthManager');
+
+Prado::using('Application.facades.UserFacade');
+
+class AuthManager extends TAuthManager {
+
+ public function logout() {
+ $cookie = $this->Application->Request->Cookies[$this->UserKey];
+ if ($cookie) {
+ $user = $this->UserManager->getUserFromCookie($cookie);
+ if ($user && $user->Name === $this->Application->User->Name) {
+ UserFacade::getInstance()->clearUserAuthKey($user);
+ }
+ }
+ parent::logout();
+ }
+
+}
+
+?>