summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins/session.py
blob: 8e480ed7d867d4e2fef59941a017aae5011430d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
# Copyright (C) 2015  FreeIPA Contributors see COPYING for license
#

from ipalib import Command
from ipalib.request import context
from ipalib.plugable import Registry

register = Registry()


@register()
class session_logout(Command):
    '''
    RPC command used to log the current user out of their session.
    '''
    NO_CLI = True

    def execute(self, *args, **options):
        ccache_name = getattr(context, 'ccache_name', None)
        if ccache_name is None:
            self.debug('session logout command: no ccache_name found')
        else:
            delattr(context, 'ccache_name')

        setattr(context, 'logout_cookie', '')

        return dict(result=None)