mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipalib: move server-side plugins to ipaserver
Move the remaining plugin code from ipalib.plugins to ipaserver.plugins. Remove the now unused ipalib.plugins package. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
33
ipaserver/plugins/session.py
Normal file
33
ipaserver/plugins/session.py
Normal file
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
|
||||
#
|
||||
|
||||
from ipalib import api, Command
|
||||
from ipalib.request import context
|
||||
from ipalib.plugable import Registry
|
||||
|
||||
if api.env.in_server:
|
||||
from ipalib.session import session_mgr
|
||||
|
||||
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):
|
||||
session_data = getattr(context, 'session_data', None)
|
||||
if session_data is None:
|
||||
self.debug('session logout command: no session_data found')
|
||||
else:
|
||||
session_id = session_data.get('session_id')
|
||||
self.debug('session logout command: session_id=%s', session_id)
|
||||
|
||||
# Notifiy registered listeners
|
||||
session_mgr.auth_mgr.logout(session_data)
|
||||
|
||||
return dict(result=None)
|
||||
Reference in New Issue
Block a user