summaryrefslogtreecommitdiff
path: root/app/frontend/facades/UserFacade.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/facades/UserFacade.php
parent7f15fb107344f5e876df6f053004415ea1759c70 (diff)
* clearing saved user auth key on logout
Diffstat (limited to 'app/frontend/facades/UserFacade.php')
-rw-r--r--app/frontend/facades/UserFacade.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/frontend/facades/UserFacade.php b/app/frontend/facades/UserFacade.php
index a976af2..0bc5863 100644
--- a/app/frontend/facades/UserFacade.php
+++ b/app/frontend/facades/UserFacade.php
@@ -160,6 +160,15 @@ class UserFacade extends Facade {
}
}
+ public function clearUserAuthKey(DbUser $user) {
+ if (!$user->IsGuest && $user->DbRecord && $user->AuthKey) {
+ $keyRecord = UserAuthKey::finder()->findByAuthKey($user->AuthKey);
+ if ($keyRecord && $keyRecord->UserID == $user->DbRecord->ID) {
+ $keyRecord->delete();
+ }
+ }
+ }
+
}
?>