2015-07-08 10:32:54 +02:00
|
|
|
#
|
|
|
|
|
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
|
|
|
|
|
#
|
|
|
|
|
|
2016-06-29 15:53:52 +02:00
|
|
|
from ipalib import Command
|
2015-07-08 10:32:54 +02:00
|
|
|
from ipalib.request import context
|
|
|
|
|
from ipalib.plugable import Registry
|
2015-07-16 10:17:26 +02:00
|
|
|
|
2015-07-08 10:32:54 +02:00
|
|
|
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):
|
2016-08-19 09:23:55 -04:00
|
|
|
ccache_name = getattr(context, 'ccache_name', None)
|
|
|
|
|
if ccache_name is None:
|
|
|
|
|
self.debug('session logout command: no ccache_name found')
|
2017-02-16 11:07:31 -05:00
|
|
|
else:
|
|
|
|
|
delattr(context, 'ccache_name')
|
2015-07-08 10:32:54 +02:00
|
|
|
|
2017-02-20 12:38:11 -05:00
|
|
|
setattr(context, 'logout_cookie', 'MagBearerToken=')
|
2015-07-08 10:32:54 +02:00
|
|
|
|
|
|
|
|
return dict(result=None)
|