create ignored groups in the auth for teamspeak
Feature Request
Be able to set up ignored groups in TeamSpeak that the auth does not try and manage or remove when updating. this would be an upgrade to the auth TeamSpeak module
This would be useful to be able to allow others to set a logi or fax or other local group on team speak with out the auth trying to remove it when it checks permissions on TeamSpeak.
the change in the code would look like this in the teamspeak manager.py file: https://pastebin.com/isKjtSi9
def update_groups(self, uid, ts_groups):
logger.debug("Updating uid %s TS3 groups %s" % (uid, ts_groups))
userid = self._get_userid(uid)
addgroups = []
remgroups = []
ignoredgroups = [] #Put the name of the group like "Logi Group"
if userid is not None:
user_ts_groups = self._user_group_list(userid)
logger.debug("User has groups on TS3 server: %s" % user_ts_groups)
for key in user_ts_groups:
user_ts_groups[key] = int(user_ts_groups[key])
for ts_group_key in ts_groups:
logger.debug("Checking if user has group %s on TS3 server." % ts_group_key)
if ts_groups[ts_group_key] not in user_ts_groups.values() and ts_group_key not in ignoredgroups:
addgroups.append(ts_groups[ts_group_key])
for user_ts_group_key in user_ts_groups:
if user_ts_groups[user_ts_group_key] not in ts_groups.values() and user_ts_group_key not in ignoredgroups:
remgroups.append(user_ts_groups[user_ts_group_key])
for g in addgroups:
logger.info("Adding Teamspeak user %s into group %s" % (userid, g))
self._add_user_to_group(userid, g)
for g in remgroups:
logger.info("Removing Teamspeak user %s from group %s" % (userid, g))
self._remove_user_from_group(userid, g)
adding a spot on the dajango admin page to select the groups from teamspeak to ignore would be good also.
Edited by colcrunch