Example #1
0
def activate_teamspeak3(request):
    logger.debug("activate_teamspeak3 called by user %s" % request.user)
    authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
    character = EveManager.get_character_by_id(authinfo.main_char_id)
    if check_if_user_has_permission(request.user, "blue_member"):
        logger.debug(
            "Adding TS3 user for blue user %s with main character %s" %
            (request.user, character))
        result = Teamspeak3Manager.add_blue_user(character.character_name,
                                                 character.corporation_ticker)
    else:
        logger.debug("Adding TS3 user for user %s with main character %s" %
                     (request.user, character))
        result = Teamspeak3Manager.add_user(character.character_name,
                                            character.corporation_ticker)

    # if its empty we failed
    if result[0] is not "":
        AuthServicesInfoManager.update_user_teamspeak3_info(
            result[0], result[1], request.user)
        logger.debug(
            "Updated authserviceinfo for user %s with TS3 credentials. Updating groups."
            % request.user)
        update_teamspeak3_groups(request.user)
        logger.info("Succesfully activated TS3 for user %s" % request.user)
        return HttpResponseRedirect("/services/")
    logger.error("Unsuccessful attempt to activate TS3 for user %s" %
                 request.user)
    return HttpResponseRedirect("/dashboard")
Example #2
0
def activate_teamspeak3(request):
    authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
    character = EveManager.get_character_by_id(authinfo.main_char_id)
    if check_if_user_has_permission(request.user, "blue_member"):
        result = Teamspeak3Manager.add_blue_user(character.character_name, character.corporation_ticker)
    else:
        result = Teamspeak3Manager.add_user(character.character_name, character.corporation_ticker)

    # if its empty we failed
    if result[0] is not "":
        AuthServicesInfoManager.update_user_teamspeak3_info(result[0], result[1], request.user)
        update_teamspeak3_groups(request.user)
        return HttpResponseRedirect("/services/")
    return HttpResponseRedirect("/dashboard")
Example #3
0
def activate_teamspeak3(request):
    authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
    character = EveManager.get_character_by_id(authinfo.main_char_id)
    if check_if_user_has_permission(request.user, "blue_member"):
        result = Teamspeak3Manager.add_blue_user(character.character_name,
                                                 character.corporation_ticker)
    else:
        result = Teamspeak3Manager.add_user(character.character_name,
                                            character.corporation_ticker)

    # if its empty we failed
    if result[0] is not "":
        AuthServicesInfoManager.update_user_teamspeak3_info(
            result[0], result[1], request.user)
        update_teamspeak3_groups(request.user)
        return HttpResponseRedirect("/services/")
    return HttpResponseRedirect("/dashboard")
Example #4
0
def activate_teamspeak3(request):
    logger.debug("activate_teamspeak3 called by user %s" % request.user)
    authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
    character = EveManager.get_character_by_id(authinfo.main_char_id)
    if check_if_user_has_permission(request.user, "blue_member"):
        logger.debug("Adding TS3 user for blue user %s with main character %s" % (request.user, character))
        result = Teamspeak3Manager.add_blue_user(character.character_name, character.corporation_ticker)
    else:
        logger.debug("Adding TS3 user for user %s with main character %s" % (request.user, character))
        result = Teamspeak3Manager.add_user(character.character_name, character.corporation_ticker)

    # if its empty we failed
    if result[0] is not "":
        AuthServicesInfoManager.update_user_teamspeak3_info(result[0], result[1], request.user)
        logger.debug("Updated authserviceinfo for user %s with TS3 credentials. Updating groups." % request.user)
        logger.info("Succesfully activated TS3 for user %s" % request.user)
        return HttpResponseRedirect("/verify_teamspeak3/")
    logger.error("Unsuccessful attempt to activate TS3 for user %s" % request.user)
    return HttpResponseRedirect("/dashboard")