Esempio n. 1
0
def api_key_removal(request, api_id):
    logger.debug("api_key_removal called by user %s for api id %s" %
                 (request.user, api_id))
    authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
    # Check if our users main id is in the to be deleted characters
    characters = EveManager.get_characters_by_owner_id(request.user.id)
    if characters is not None:
        for character in characters:
            if character.character_id == authinfo.main_char_id:
                if character.api_id == api_id:
                    # TODO: Remove services also
                    if authinfo.is_blue:
                        logger.debug(
                            "Blue user %s deleting api for main character. Disabling."
                            % request.user)
                        disable_blue_member(request.user)
                    else:
                        logger.debug(
                            "User %s deleting api for main character. Disabling."
                            % request.user)
                        disable_member(request.user, authinfo.main_char_id)

    EveManager.delete_api_key_pair(api_id, request.user.id)
    EveManager.delete_characters_by_api_id(api_id, request.user.id)
    logger.info(
        "Succesfully processed api delete request by user %s for api %s" %
        (request.user, api_id))
    return HttpResponseRedirect("/api_key_management/")
Esempio n. 2
0
def api_key_removal(request, api_id):
    authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
    # Check if our users main id is in the to be deleted characters
    characters = EveManager.get_characters_by_owner_id(request.user.id)
    if characters is not None:
        for character in characters:
            if character.character_id == authinfo.main_char_id:
                if character.api_id == api_id:
                    # TODO: Remove servies also
                    if authinfo.is_blue:
                        disable_blue_member(request.user)
                    else:
                        disable_alliance_member(request.user, authinfo.main_char_id)

    EveManager.delete_api_key_pair(api_id, request.user.id)
    EveManager.delete_characters_by_api_id(api_id, request.user.id)

    return HttpResponseRedirect("/api_key_management/")
Esempio n. 3
0
def api_key_removal(request, api_id):
    authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
    # Check if our users main id is in the to be deleted characters
    characters = EveManager.get_characters_by_owner_id(request.user.id)
    if characters is not None:
        for character in characters:
            if character.character_id == authinfo.main_char_id:
                if character.api_id == api_id:
                    # TODO: Remove servies also
                    if authinfo.is_blue:
                        disable_blue_member(request.user)
                    else:
                        disable_alliance_member(request.user,
                                                authinfo.main_char_id)

    EveManager.delete_api_key_pair(api_id, request.user.id)
    EveManager.delete_characters_by_api_id(api_id, request.user.id)

    return HttpResponseRedirect("/api_key_management/")
Esempio n. 4
0
def api_key_removal(request, api_id):
    logger.debug("api_key_removal called by user %s for api id %s" % (request.user, api_id))
    authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
    # Check if our users main id is in the to be deleted characters
    characters = EveManager.get_characters_by_owner_id(request.user.id)
    if characters is not None:
        for character in characters:
            if character.character_id == authinfo.main_char_id:
                if character.api_id == api_id:
                    # TODO: Remove services also
                    if authinfo.is_blue:
                        logger.debug("Blue user %s deleting api for main character. Disabling." % request.user)
                        disable_blue_member(request.user)
                    else:
                        logger.debug("User %s deleting api for main character. Disabling." % request.user)
                        disable_member(request.user, authinfo.main_char_id)

    EveManager.delete_api_key_pair(api_id, request.user.id)
    EveManager.delete_characters_by_api_id(api_id, request.user.id)
    logger.info("Succesfully processed api delete request by user %s for api %s" % (request.user, api_id))
    return HttpResponseRedirect("/api_key_management/")