summaryrefslogtreecommitdiff
path: root/app/frontend/user/AuthManager.php
blob: 54f92e4f0e7716d8b5081a226972d08b3cea040a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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();
    }

}

?>