summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/bonafide
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/bonafide')
-rw-r--r--src/leap/bitmask/bonafide/_protocol.py7
-rw-r--r--src/leap/bitmask/bonafide/service.py3
2 files changed, 10 insertions, 0 deletions
diff --git a/src/leap/bitmask/bonafide/_protocol.py b/src/leap/bitmask/bonafide/_protocol.py
index 7917f383..01919c7d 100644
--- a/src/leap/bitmask/bonafide/_protocol.py
+++ b/src/leap/bitmask/bonafide/_protocol.py
@@ -147,6 +147,13 @@ class BonafideProtocol(object):
d.addCallback(lambda _: '%s logged out' % full_id)
return d
+ def do_list_users(self):
+ users = []
+ for user, session in self._sessions.items():
+ users.append({'userid': user,
+ 'authenticated': session.is_authenticated})
+ return users
+
def do_change_password(self, full_id, current_password, new_password):
log.msg('Change password for %s' % full_id)
if (full_id not in self._sessions or
diff --git a/src/leap/bitmask/bonafide/service.py b/src/leap/bitmask/bonafide/service.py
index 1f0d6362..fbe6846e 100644
--- a/src/leap/bitmask/bonafide/service.py
+++ b/src/leap/bitmask/bonafide/service.py
@@ -106,6 +106,9 @@ class BonafideService(HookableService):
d.addCallback(lambda response: {'logout': 'ok'})
return d
+ def do_list_users(self):
+ return self._bonafide.do_list_users()
+
def do_change_password(self, username, current_password, new_password):
def notify_passphrase_change(_):
data = dict(username=username, password=new_password)