1<?php
2/**
3 * Federated Login for DokuWiki - logout action handling class
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @link       http://www.dokuwiki.org/plugin:fedauth
7 * @author     Aoi Karasu <aoikarasu@gmail.com>
8 */
9
10/**
11 * Class responsible for clearing the user-related fedauth data on logout.
12 *
13 * @author     Aoi Karasu <aoikarasu@gmail.com>
14 */
15class fa_logout extends fa_base {
16
17    /**
18     * Creates the class instance bound to a plugin instance and an authentication provider.
19     *
20     * @param objref $manager object reference to the admin plugin
21     * @param string $cmd name of the command to handle
22     * @param string $provid (optional) an authentication provider id
23     */
24    function __construct(&$manager, $cmd, $provid='') {
25        parent::__construct(&$manager, $cmd, $provid);
26    }
27
28    /**
29     * Removes fedauth cookie and clears related session data.
30     */
31    function process_logout() {
32        $this->success = true;
33        if ($this->manager->cookie) {
34            $this->manager->cookie->clean();
35            return $this->info('logoutok');
36        }
37        return null;
38    }
39
40} /* fa_logout */
41
42/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
43