mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
Added teamspeak3 fix
This commit is contained in:
parent
c9bd7afd01
commit
2c57e28cf8
@ -91,7 +91,7 @@ class Teamspeak3Manager:
|
|||||||
else:
|
else:
|
||||||
print '1024 error'
|
print '1024 error'
|
||||||
|
|
||||||
print outlist
|
return outlist
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _add_user_to_group(uid, groupname):
|
def _add_user_to_group(uid, groupname):
|
||||||
@ -125,21 +125,23 @@ class Teamspeak3Manager:
|
|||||||
token = ""
|
token = ""
|
||||||
|
|
||||||
server_groups = Teamspeak3Manager._group_list()
|
server_groups = Teamspeak3Manager._group_list()
|
||||||
if not settings.DEFAULT_ALLIANCE_GROUP in server_groups:
|
|
||||||
Teamspeak3Manager._create_group(settings.DEFAULT_ALLIANCE_GROUP)
|
|
||||||
|
|
||||||
alliange_group_id = Teamspeak3Manager._group_id_by_name(settings.DEFAULT_ALLIANCE_GROUP)
|
if server_groups:
|
||||||
|
if not settings.DEFAULT_ALLIANCE_GROUP in server_groups:
|
||||||
|
Teamspeak3Manager._create_group(settings.DEFAULT_ALLIANCE_GROUP)
|
||||||
|
|
||||||
ret = server.send_command('tokenadd', {'tokentype': 0, 'tokenid1': alliange_group_id, 'tokenid2': 0,
|
alliange_group_id = Teamspeak3Manager._group_id_by_name(settings.DEFAULT_ALLIANCE_GROUP)
|
||||||
'tokendescription': username_clean,
|
|
||||||
'tokencustomset': "ident=sso_uid value=%s" % username_clean})
|
|
||||||
|
|
||||||
try:
|
ret = server.send_command('tokenadd', {'tokentype': 0, 'tokenid1': alliange_group_id, 'tokenid2': 0,
|
||||||
if 'keys' in ret:
|
'tokendescription': username_clean,
|
||||||
if 'token' in ret['keys']:
|
'tokencustomset': "ident=sso_uid value=%s" % username_clean})
|
||||||
token = ret['keys']['token']
|
|
||||||
except:
|
try:
|
||||||
pass
|
if 'keys' in ret:
|
||||||
|
if 'token' in ret['keys']:
|
||||||
|
token = ret['keys']['token']
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
return username_clean, token
|
return username_clean, token
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user