From af27100e35f30f91f3c8f3eb4b8fcef978d11eae Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Mon, 3 Oct 2016 17:40:09 -0400 Subject: [feature] handle invite codes In the command line, --invitecode is a new optional parameter to the command "user create". bonafide service handles the invite codes. javascript library should be updated accordingly - Resolves: #7550 --- src/leap/bitmask/core/dispatcher.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/leap/bitmask/core/dispatcher.py') diff --git a/src/leap/bitmask/core/dispatcher.py b/src/leap/bitmask/core/dispatcher.py index a2fd6387..5b7b836e 100644 --- a/src/leap/bitmask/core/dispatcher.py +++ b/src/leap/bitmask/core/dispatcher.py @@ -107,12 +107,17 @@ class UserCmd(SubCommand): @register_method("{'signup': 'ok', 'user': str}") def do_CREATE(self, bonafide, *parts): - user, password = parts[2], parts[3] + # params are: [user, create, full_id, password, invite, autoconf] + user, password, invite = parts[2], parts[3], parts[4] + + # TODO factor out null/bool conversion to a util function. + if invite == 'none': + invite = None autoconf = False - if len(parts) > 4: - if parts[4] == 'true': + if len(parts) > 5: + if parts[5] == 'true': autoconf = True - return bonafide.do_signup(user, password, autoconf) + return bonafide.do_signup(user, password, invite, autoconf) @register_method("{'logout': 'ok'}") def do_LOGOUT(self, bonafide, *parts): -- cgit v1.2.3