def add_to_databases(user, groups, syncgroups): authserviceinfo = None try: authserviceinfo = AuthServicesInfo.objects.get(user=user) except: pass if authserviceinfo: authserviceinfo = AuthServicesInfo.objects.get(user=user) update = False for group in groups: syncgroup = syncgroups.filter(groupname=group.name) if not syncgroup: synccache = SyncGroupCache() synccache.groupname = group.name synccache.user = user synccache.save() update = True if update: if authserviceinfo.jabber_username != "": update_jabber_groups(user) if authserviceinfo.mumble_username != "": update_mumble_groups(user) if authserviceinfo.forum_username != "": update_forum_groups(user)
def create_syncgroup_for_user(user, groupname, servicename): logger.debug("Creating syncgroupcache for user %s group %s in service %s" % (user, groupname, servicename)) synccache = SyncGroupCache() synccache.groupname = groupname synccache.user = user synccache.servicename = servicename synccache.save() logger.info("Created syncgroup for user %s group %s in service %s" % (user, groupname, servicename))
def create_syncgroup_for_user(user, groupname, servicename): synccache = SyncGroupCache() synccache.groupname = groupname synccache.user = user synccache.servicename = servicename synccache.save()