summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/core
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-10-03 17:40:09 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-10-04 11:48:30 -0400
commitaf27100e35f30f91f3c8f3eb4b8fcef978d11eae (patch)
tree92e1bdb9ebdb8e00aa84dbfefbda1b75e6cb883c /src/leap/bitmask/core
parentff3ed1e9418eab21fd42bb5ddd96a3851a25801c (diff)
[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
Diffstat (limited to 'src/leap/bitmask/core')
-rw-r--r--src/leap/bitmask/core/dispatcher.py13
1 files changed, 9 insertions, 4 deletions
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):