mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-12 22:10:16 +02:00
Merge pull request #1 from Adarnof/temp
Merge changes in temp branch to orgin toggle branch
This commit is contained in:
commit
8945cf3a2a
@ -20,6 +20,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
|||||||
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
|
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
|
# Generate a new key here: http://www.miniwebtool.com/django-secret-key-generator/
|
||||||
SECRET_KEY = os.environ.get('AA_SECRET_KEY', '5xvh4e0x&@-$6(kj%4^80pdo1n5v-!mtx(e(1tw@kn-1le*ts@')
|
SECRET_KEY = os.environ.get('AA_SECRET_KEY', '5xvh4e0x&@-$6(kj%4^80pdo1n5v-!mtx(e(1tw@kn-1le*ts@')
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
# SECURITY WARNING: don't run with debug turned on in production!
|
||||||
@ -111,8 +112,11 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
|||||||
'django.core.context_processors.tz',
|
'django.core.context_processors.tz',
|
||||||
'django.contrib.messages.context_processors.messages',
|
'django.contrib.messages.context_processors.messages',
|
||||||
'django.core.context_processors.request',
|
'django.core.context_processors.request',
|
||||||
|
'util.context_processors.is_corp',
|
||||||
'util.context_processors.corp_id',
|
'util.context_processors.corp_id',
|
||||||
'util.context_processors.corp_name',
|
'util.context_processors.corp_name',
|
||||||
|
'util.context_processors.alliance_id',
|
||||||
|
'util.context_processors.alliance_name',
|
||||||
'util.context_processors.jabber_url',
|
'util.context_processors.jabber_url',
|
||||||
'util.context_processors.domain_url'
|
'util.context_processors.domain_url'
|
||||||
)
|
)
|
||||||
@ -166,7 +170,7 @@ IS_CORP = 'False' == os.environ.get('AA_IS_CORP', 'True')
|
|||||||
# DOMAIN - The alliance auth domain_url
|
# DOMAIN - The alliance auth domain_url
|
||||||
# EMAIL_HOST - SMTP Server URL
|
# EMAIL_HOST - SMTP Server URL
|
||||||
# EMAIL_PORT - SMTP Server PORT
|
# EMAIL_PORT - SMTP Server PORT
|
||||||
# EMAIL_HOST_USER - Email Username
|
# EMAIL_HOST_USER - Email Username (for gmail, the part before @gmail.com)
|
||||||
# EMAIL_HOST_PASSWORD - Email Password
|
# EMAIL_HOST_PASSWORD - Email Password
|
||||||
# EMAIL_USE_TLS - Set to use TLS encryption
|
# EMAIL_USE_TLS - Set to use TLS encryption
|
||||||
#################
|
#################
|
||||||
@ -203,11 +207,13 @@ ENABLE_AUTH_TEAMSPEAK3 = 'True' == os.environ.get('AA_ENABLE_AUTH_TEAMSPEAK3', '
|
|||||||
#####################
|
#####################
|
||||||
# Blue service Setup
|
# Blue service Setup
|
||||||
#####################
|
#####################
|
||||||
|
# BLUE_STANDING - The default lowest standings setting to consider blue
|
||||||
# ENABLE_BLUE_FORUM - Enable forum support in the auth for blues
|
# ENABLE_BLUE_FORUM - Enable forum support in the auth for blues
|
||||||
# ENABLE_BLUE_JABBER - Enable jabber support in the auth for blues
|
# ENABLE_BLUE_JABBER - Enable jabber support in the auth for blues
|
||||||
# ENABLE_BLUE_MUMBLE - Enable mumble support in the auth for blues
|
# ENABLE_BLUE_MUMBLE - Enable mumble support in the auth for blues
|
||||||
# ENABLE_BLUE_IPBOARD - Enable IPBoard forum support in the auth for blues
|
# ENABLE_BLUE_IPBOARD - Enable IPBoard forum support in the auth for blues
|
||||||
#####################
|
#####################
|
||||||
|
BLUE_STANDING = float(os.environ.get('AA_BLUE_STANDING', '5.0'))
|
||||||
ENABLE_BLUE_FORUM = 'True' == os.environ.get('AA_ENABLE_BLUE_FORUM', 'False')
|
ENABLE_BLUE_FORUM = 'True' == os.environ.get('AA_ENABLE_BLUE_FORUM', 'False')
|
||||||
ENABLE_BLUE_JABBER = 'True' == os.environ.get('AA_ENABLE_BLUE_JABBER', 'False')
|
ENABLE_BLUE_JABBER = 'True' == os.environ.get('AA_ENABLE_BLUE_JABBER', 'False')
|
||||||
ENABLE_BLUE_MUMBLE = 'True' == os.environ.get('AA_ENABLE_BLUE_MUMBLE', 'True')
|
ENABLE_BLUE_MUMBLE = 'True' == os.environ.get('AA_ENABLE_BLUE_MUMBLE', 'True')
|
||||||
@ -217,26 +223,23 @@ ENABLE_BLUE_TEAMSPEAK3 = 'True' == os.environ.get('AA_ENABLE_BLUE_TEAMSPEAK3', '
|
|||||||
#########################
|
#########################
|
||||||
# Corp Configuration
|
# Corp Configuration
|
||||||
#########################
|
#########################
|
||||||
|
# If running in alliance mode, the following should be for the executor corp#
|
||||||
# CORP_ID - Set this to your corp ID (get this from https://zkillboard.com/corporation/#######)
|
# CORP_ID - Set this to your corp ID (get this from https://zkillboard.com/corporation/#######)
|
||||||
# CORP_NAME - Set this to your Corporation Name
|
# CORP_NAME - Set this to your Corporation Name
|
||||||
# CORP_API_ID - Set this to the api id for the corp API key
|
# CORP_API_ID - Set this to the api id for the corp API key
|
||||||
# CORP_API_VCODE - Set this to the api vcode for the corp API key
|
# CORP_API_VCODE - Set this to the api vcode for the corp API key
|
||||||
# BLUE_STANDING - The default lowest standings setting to consider blue
|
|
||||||
########################
|
########################
|
||||||
CORP_ID = os.environ.get('AA_CORP_ID', '')
|
CORP_ID = os.environ.get('AA_CORP_ID', '')
|
||||||
CORP_NAME = os.environ.get('AA_CORP_NAME', '')
|
CORP_NAME = os.environ.get('AA_CORP_NAME', '')
|
||||||
CORP_API_ID = os.environ.get('AA_CORP_API_ID', '')
|
CORP_API_ID = os.environ.get('AA_CORP_API_ID', '')
|
||||||
CORP_API_VCODE = os.environ.get('AA_CORP_API_VCODE', '')
|
CORP_API_VCODE = os.environ.get('AA_CORP_API_VCODE', '')
|
||||||
BLUE_STANDING = float(os.environ.get('AA_BLUE_STANDING', '5.0'))
|
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
# Alliance Configuration
|
# Alliance Configuration
|
||||||
#########################
|
#########################
|
||||||
# ALLIANCE_ID - Set this to your corp ID (get this from https://zkillboard.com/corporation/#######)
|
# ALLIANCE_ID - Set this to your Alliance ID (get this from https://zkillboard.com/alliance/#######)
|
||||||
# ALLIANCE_NAME - Set this to your Corporation Name
|
# ALLIANCE_NAME - Set this to your Alliance Name
|
||||||
# ALLIANCE_API_ID - Set this to the api id for the corp API key
|
|
||||||
# ALLIANCE_API_VCODE - Set this to the api vcode for the corp API key
|
|
||||||
# BLUE_STANDING - The default lowest standings setting to consider blue
|
|
||||||
########################
|
########################
|
||||||
ALLIANCE_ID = os.environ.get('AA_ALLIANCE_ID', '')
|
ALLIANCE_ID = os.environ.get('AA_ALLIANCE_ID', '')
|
||||||
ALLIANCE_NAME = os.environ.get('AA_ALLIANCE_NAME', '')
|
ALLIANCE_NAME = os.environ.get('AA_ALLIANCE_NAME', '')
|
||||||
@ -258,7 +261,7 @@ JACK_KNIFE_URL = os.environ.get('AA_JACK_KNIFE_URL', 'http://ridetheclown.com/ev
|
|||||||
# IPBOARD_APIKEY - Api key to interact with ipboard
|
# IPBOARD_APIKEY - Api key to interact with ipboard
|
||||||
# IPBOARD_APIMODULE - Module for alliance auth *leave alone*
|
# IPBOARD_APIMODULE - Module for alliance auth *leave alone*
|
||||||
#####################
|
#####################
|
||||||
FORUM_URL = os.environ.get('AA_FORUM_URL', "")
|
FORUM_URL = os.environ.get('AA_FORUM_URL', "http://someurl.com")
|
||||||
IPBOARD_ENDPOINT = os.environ.get('AA_IPBOARD_ENDPOINT', 'someaddress.com/interface/board/index.php')
|
IPBOARD_ENDPOINT = os.environ.get('AA_IPBOARD_ENDPOINT', 'someaddress.com/interface/board/index.php')
|
||||||
IPBOARD_APIKEY = os.environ.get('AA_IPBOARD_APIKEY', 'somekeyhere')
|
IPBOARD_APIKEY = os.environ.get('AA_IPBOARD_APIKEY', 'somekeyhere')
|
||||||
IPBOARD_APIMODULE = 'aa'
|
IPBOARD_APIMODULE = 'aa'
|
||||||
@ -269,15 +272,16 @@ IPBOARD_APIMODULE = 'aa'
|
|||||||
# JABBER_URL - Jabber address url
|
# JABBER_URL - Jabber address url
|
||||||
# JABBER_PORT - Jabber service portal
|
# JABBER_PORT - Jabber service portal
|
||||||
# JABBER_SERVER - Jabber server url
|
# JABBER_SERVER - Jabber server url
|
||||||
# OPENFIRE_ADDRESS - Address of the openfire admin console
|
# OPENFIRE_ADDRESS - Address of the openfire admin console including port
|
||||||
# OPENFIRE_SECRET_KEY - Openfire userservice secret key
|
# Please use http with 9090 or https with 9091
|
||||||
|
# OPENFIRE_SECRET_KEY - Openfire REST API secret key
|
||||||
# BROADCAST_USER - Broadcast user JID
|
# BROADCAST_USER - Broadcast user JID
|
||||||
# BROADCAST_USER_PASSWORD - Broadcast user password
|
# BROADCAST_USER_PASSWORD - Broadcast user password
|
||||||
######################
|
######################
|
||||||
JABBER_URL = os.environ.get('AA_JABBER_URL', "")
|
JABBER_URL = os.environ.get('AA_JABBER_URL', "someurl.com")
|
||||||
JABBER_PORT = int(os.environ.get('AA_JABBER_PORT', '5223'))
|
JABBER_PORT = int(os.environ.get('AA_JABBER_PORT', '5223'))
|
||||||
JABBER_SERVER = os.environ.get('AA_JABBER_SERVER', "")
|
JABBER_SERVER = os.environ.get('AA_JABBER_SERVER', "someurl.com")
|
||||||
OPENFIRE_ADDRESS = os.environ.get('AA_OPENFIRE_ADDRESS', "")
|
OPENFIRE_ADDRESS = os.environ.get('AA_OPENFIRE_ADDRESS', "http://someurl.com:9090")
|
||||||
OPENFIRE_SECRET_KEY = os.environ.get('AA_OPENFIRE_SECRET_KEY', "somekey")
|
OPENFIRE_SECRET_KEY = os.environ.get('AA_OPENFIRE_SECRET_KEY', "somekey")
|
||||||
BROADCAST_USER = os.environ.get('AA_BROADCAST_USER', "broadcast@") + JABBER_URL
|
BROADCAST_USER = os.environ.get('AA_BROADCAST_USER', "broadcast@") + JABBER_URL
|
||||||
BROADCAST_USER_PASSWORD = os.environ.get('AA_BROADCAST_USER_PASSWORD', "somepassword")
|
BROADCAST_USER_PASSWORD = os.environ.get('AA_BROADCAST_USER_PASSWORD', "somepassword")
|
||||||
@ -288,7 +292,7 @@ BROADCAST_USER_PASSWORD = os.environ.get('AA_BROADCAST_USER_PASSWORD', "somepass
|
|||||||
# MUMBLE_URL - Mumble server url
|
# MUMBLE_URL - Mumble server url
|
||||||
# MUMBLE_SERVER_ID - Mumble server id
|
# MUMBLE_SERVER_ID - Mumble server id
|
||||||
######################################
|
######################################
|
||||||
MUMBLE_URL = os.environ.get('AA_MUMBLE_URL', "")
|
MUMBLE_URL = os.environ.get('AA_MUMBLE_URL', "someurl.com")
|
||||||
MUMBLE_SERVER_ID = int(os.environ.get('AA_MUMBLE_SERVER_ID', '1'))
|
MUMBLE_SERVER_ID = int(os.environ.get('AA_MUMBLE_SERVER_ID', '1'))
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
@ -302,7 +306,7 @@ MUMBLE_SERVER_ID = int(os.environ.get('AA_MUMBLE_SERVER_ID', '1'))
|
|||||||
# TEAMSPEAK3_AUTHED_GROUP_ID - Default authed group id
|
# TEAMSPEAK3_AUTHED_GROUP_ID - Default authed group id
|
||||||
# TEAMSPEAK3_PUBLIC_URL - teamspeak3 public url used for link creation
|
# TEAMSPEAK3_PUBLIC_URL - teamspeak3 public url used for link creation
|
||||||
######################################
|
######################################
|
||||||
TEAMSPEAK3_SERVER_IP = os.environ.get('AA_TEAMSPEAK3_SERVER_IP', '')
|
TEAMSPEAK3_SERVER_IP = os.environ.get('AA_TEAMSPEAK3_SERVER_IP', '127.0.0.1')
|
||||||
TEAMSPEAK3_SERVER_PORT = int(os.environ.get('AA_TEAMSPEAK3_SERVER_PORT', '10011'))
|
TEAMSPEAK3_SERVER_PORT = int(os.environ.get('AA_TEAMSPEAK3_SERVER_PORT', '10011'))
|
||||||
TEAMSPEAK3_SERVERQUERY_USER = os.environ.get('AA_TEAMSPEAK3_SERVERQUERY_USER', 'serveradmin')
|
TEAMSPEAK3_SERVERQUERY_USER = os.environ.get('AA_TEAMSPEAK3_SERVERQUERY_USER', 'serveradmin')
|
||||||
TEAMSPEAK3_SERVERQUERY_PASSWORD = os.environ.get('AA_TEAMSPEAK3_SERVERQUERY_PASSWORD', 'passwordhere')
|
TEAMSPEAK3_SERVERQUERY_PASSWORD = os.environ.get('AA_TEAMSPEAK3_SERVERQUERY_PASSWORD', 'passwordhere')
|
||||||
|
@ -1 +0,0 @@
|
|||||||
28392
|
|
@ -225,7 +225,8 @@ def run_api_refresh():
|
|||||||
character = EveManager.get_character_by_id(authserviceinfo.main_char_id)
|
character = EveManager.get_character_by_id(authserviceinfo.main_char_id)
|
||||||
corp = EveManager.get_corporation_info_by_id(character.corporation_id)
|
corp = EveManager.get_corporation_info_by_id(character.corporation_id)
|
||||||
main_corp_id = EveManager.get_charater_corporation_id_by_id(authserviceinfo.main_char_id)
|
main_corp_id = EveManager.get_charater_corporation_id_by_id(authserviceinfo.main_char_id)
|
||||||
if main_corp_id == settings.CORP_ID:
|
main_alliance_id = EveManager.get_charater_alliance_id_by_id(authserviceinfo.main_char_id)
|
||||||
|
if (settings.IS_CORP and main_corp_id == settings.CORP_ID) or (not settings.IS_CORP and main_alliance_id == settings.ALLIANCE_ID):
|
||||||
if not check_if_user_has_permission(user, "member"):
|
if not check_if_user_has_permission(user, "member"):
|
||||||
#transition from blue to member
|
#transition from blue to member
|
||||||
if check_if_user_has_permission(user, "blue_member"):
|
if check_if_user_has_permission(user, "blue_member"):
|
||||||
@ -237,29 +238,38 @@ def run_api_refresh():
|
|||||||
elif corp is not None:
|
elif corp is not None:
|
||||||
if corp.is_blue is not True:
|
if corp.is_blue is not True:
|
||||||
if check_if_user_has_permission(user, "member"):
|
if check_if_user_has_permission(user, "member"):
|
||||||
|
#transition from member to nobody
|
||||||
disable_alliance_member(user, authserviceinfo.main_char_id)
|
disable_alliance_member(user, authserviceinfo.main_char_id)
|
||||||
elif check_if_user_has_permission(user, "blue_member"):
|
elif check_if_user_has_permission(user, "blue_member"):
|
||||||
|
#transition from blue to nobody
|
||||||
disable_blue_member(user)
|
disable_blue_member(user)
|
||||||
else:
|
else:
|
||||||
|
#stay nobody, make sure no services
|
||||||
deactivate_services(user)
|
deactivate_services(user)
|
||||||
else:
|
else:
|
||||||
|
change_status = False
|
||||||
if check_if_user_has_permission(user, "member"):
|
if check_if_user_has_permission(user, "member"):
|
||||||
remove_member_permission(user, "member")
|
#remove auth member to prepare for member to blue transition
|
||||||
remove_user_from_group(user, settings.DEFAULT_AUTH_GROUP)
|
disable_alliance_member(user, authserviceinfo.main_char_id)
|
||||||
|
change_status = True
|
||||||
if not check_if_user_has_permission(user, "blue_member"):
|
if not check_if_user_has_permission(user, "blue_member"):
|
||||||
|
#perform member to blue transition
|
||||||
add_member_permission(user, "blue_member")
|
add_member_permission(user, "blue_member")
|
||||||
add_user_to_group(user, settings.DEFAULT_BLUE_GROUP)
|
add_user_to_group(user, settings.DEFAULT_BLUE_GROUP)
|
||||||
|
change_status = True
|
||||||
|
|
||||||
#Fix mumble username ticker
|
#if user has mumble account, rename it with proper ticker
|
||||||
MumbleManager.delete_user(authserviceinfo.mumble_username)
|
if (not authserviceinfo.mumble_username == "") and change_status:
|
||||||
remove_all_syncgroups_for_service(user, "mumble")
|
#Fix mumble username ticker
|
||||||
AuthServicesInfoManager.update_user_mumble_info("", "", request.user)
|
MumbleManager.delete_user(authserviceinfo.mumble_username)
|
||||||
|
remove_all_syncgroups_for_service(user, "mumble")
|
||||||
#make new user (how generous)
|
AuthServicesInfoManager.update_user_mumble_info("", "", request.user)
|
||||||
result = MumbleManager.create_blue_user(character.corporation_ticker, character.character_name)
|
#make new user (how generous)
|
||||||
AuthServicesInfoManager.update_user_mumble_info(result[0], result[1], user)
|
result = MumbleManager.create_blue_user(character.corporation_ticker, character.character_name)
|
||||||
update_mumble_groups(request.user)
|
AuthServicesInfoManager.update_user_mumble_info(result[0], result[1], user)
|
||||||
|
update_mumble_groups(request.user)
|
||||||
else:
|
else:
|
||||||
|
# disable accounts with missing corp data
|
||||||
if check_if_user_has_permission(user, "member"):
|
if check_if_user_has_permission(user, "member"):
|
||||||
disable_alliance_member(user, authserviceinfo.main_char_id)
|
disable_alliance_member(user, authserviceinfo.main_char_id)
|
||||||
elif check_if_user_has_permission(user, "blue_member"):
|
elif check_if_user_has_permission(user, "blue_member"):
|
||||||
@ -268,7 +278,7 @@ def run_api_refresh():
|
|||||||
deactivate_services(user)
|
deactivate_services(user)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# nuke it
|
# disable accounts with invalid keys
|
||||||
if check_if_user_has_permission(user, "member"):
|
if check_if_user_has_permission(user, "member"):
|
||||||
disable_alliance_member(user, authserviceinfo.main_char_id)
|
disable_alliance_member(user, authserviceinfo.main_char_id)
|
||||||
elif check_if_user_has_permission(user, "blue_member"):
|
elif check_if_user_has_permission(user, "blue_member"):
|
||||||
@ -286,12 +296,27 @@ def run_corp_update():
|
|||||||
# I am not proud of this block of code
|
# I am not proud of this block of code
|
||||||
if EveApiManager.check_if_api_server_online():
|
if EveApiManager.check_if_api_server_online():
|
||||||
|
|
||||||
# Create the corp
|
if settings.IS_CORP:
|
||||||
corpinfo = EveApiManager.get_corporation_information(settings.CORP_ID)
|
# Create the corp
|
||||||
if not EveManager.check_if_corporation_exists_by_id(corpinfo['id']):
|
corpinfo = EveApiManager.get_corporation_information(settings.CORP_ID)
|
||||||
EveManager.create_corporation_info(corpinfo['id'], corpinfo['name'], corpinfo['ticker'],
|
if not EveManager.check_if_corporation_exists_by_id(corpinfo['id']):
|
||||||
corpinfo['members']['current'], False, None)
|
EveManager.create_corporation_info(corpinfo['id'], corpinfo['name'], corpinfo['ticker'],
|
||||||
|
corpinfo['members']['current'], False, None)
|
||||||
|
else:
|
||||||
|
# Updated alliance info
|
||||||
|
alliance_info = EveApiManager.get_alliance_information(settings.ALLIANCE_ID)
|
||||||
|
|
||||||
|
# Populate alliance info
|
||||||
|
if not EveManager.check_if_alliance_exists_by_id(settings.ALLIANCE_ID):
|
||||||
|
EveManager.create_alliance_info(settings.ALLIANCE_ID, alliance_info['name'], alliance_info['ticker'],
|
||||||
|
alliance_info['executor_id'], alliance_info['member_count'], False)
|
||||||
|
alliance = EveManager.get_alliance_info_by_id(settings.ALLIANCE_ID)
|
||||||
|
# Create the corps in the alliance
|
||||||
|
for alliance_corp in alliance_info['member_corps']:
|
||||||
|
corpinfo = EveApiManager.get_corporation_information(alliance_corp)
|
||||||
|
if not EveManager.check_if_corporation_exists_by_id(corpinfo['id']):
|
||||||
|
EveManager.create_corporation_info(corpinfo['id'], corpinfo['name'], corpinfo['ticker'],
|
||||||
|
corpinfo['members']['current'], False, alliance)
|
||||||
|
|
||||||
#determine what level of standings to check
|
#determine what level of standings to check
|
||||||
#refer to https://github.com/eve-val/evelink/blob/master/evelink/parsing/contact_list.py#L43
|
#refer to https://github.com/eve-val/evelink/blob/master/evelink/parsing/contact_list.py#L43
|
||||||
@ -333,7 +358,10 @@ def run_corp_update():
|
|||||||
# Update all allinace info's
|
# Update all allinace info's
|
||||||
for all_alliance_info in EveManager.get_all_alliance_info():
|
for all_alliance_info in EveManager.get_all_alliance_info():
|
||||||
all_alliance_api_info = EveApiManager.get_alliance_information(all_alliance_info.alliance_id)
|
all_alliance_api_info = EveApiManager.get_alliance_information(all_alliance_info.alliance_id)
|
||||||
if standing_level in corp_standings:
|
if (not settings.IS_CORP and all_alliance_info.alliance_id == settings.ALLIANCE_ID):
|
||||||
|
EveManager.update_alliance_info(all_alliance_api_info['id'], all_alliance_api_info['executor_id'],
|
||||||
|
all_alliance_api_info['member_count'], False)
|
||||||
|
elif standing_level in corp_standings:
|
||||||
if int(all_alliance_info.alliance_id) in corp_standings[standing_level]:
|
if int(all_alliance_info.alliance_id) in corp_standings[standing_level]:
|
||||||
if int(corp_standings[standing_level][int(all_alliance_info.alliance_id)][
|
if int(corp_standings[standing_level][int(all_alliance_info.alliance_id)][
|
||||||
'standing']) >= settings.BLUE_STANDING:
|
'standing']) >= settings.BLUE_STANDING:
|
||||||
@ -362,7 +390,9 @@ def run_corp_update():
|
|||||||
|
|
||||||
if alliance is not None and all_corp_info.alliance is not None:
|
if alliance is not None and all_corp_info.alliance is not None:
|
||||||
|
|
||||||
if int(alliance.alliance_id) in corp_standings[standing_level]:
|
if (not settings.IS_CORP) and (all_corp_info.alliance.alliance_id == settings.ALLIANCE_ID):
|
||||||
|
EveManager.update_corporation_info(corpinfo['id'], corpinfo['members']['current'], alliance, False)
|
||||||
|
elif int(alliance.alliance_id) in corp_standings[standing_level]:
|
||||||
if int(corp_standings[standing_level][int(alliance.alliance_id)][
|
if int(corp_standings[standing_level][int(alliance.alliance_id)][
|
||||||
'standing']) >= settings.BLUE_STANDING:
|
'standing']) >= settings.BLUE_STANDING:
|
||||||
EveManager.update_corporation_info(corpinfo['id'], corpinfo['members']['current'], alliance,
|
EveManager.update_corporation_info(corpinfo['id'], corpinfo['members']['current'], alliance,
|
||||||
@ -383,15 +413,18 @@ def run_corp_update():
|
|||||||
else:
|
else:
|
||||||
EveManager.update_corporation_info(corpinfo['id'], corpinfo['members']['current'], None, False)
|
EveManager.update_corporation_info(corpinfo['id'], corpinfo['members']['current'], None, False)
|
||||||
|
|
||||||
# Nuke the none believers
|
# Remove irrelevent corp and alliance models
|
||||||
# Check the corps
|
# Check the corps
|
||||||
for all_corp_info in EveManager.get_all_corporation_info():
|
for all_corp_info in EveManager.get_all_corporation_info():
|
||||||
if all_corp_info.corporation_id != settings.CORP_ID:
|
if (settings.IS_CORP and all_corp_info.corporation_id != settings.CORP_ID) or (not settings.IS_CORP and all_corp_info.alliance_id != settings.ALLIANCE_ID):
|
||||||
if not all_corp_info.is_blue:
|
if not all_corp_info.is_blue:
|
||||||
all_corp_info.delete()
|
all_corp_info.delete()
|
||||||
|
|
||||||
# Check the alliances
|
# Check the alliances
|
||||||
for all_alliance_info in EveManager.get_all_alliance_info():
|
for all_alliance_info in EveManager.get_all_alliance_info():
|
||||||
|
if (not settings.IS_CORP and all_alliance_info.alliance_id != settings.ALLIANCE_ID):
|
||||||
|
if all_alliance_info.is_blue is not True:
|
||||||
|
all_alliance_info.delete()
|
||||||
if all_alliance_info.is_blue is not True:
|
if all_alliance_info.is_blue is not True:
|
||||||
all_alliance_info.delete()
|
all_alliance_info.delete()
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ from eveonline.managers import EveManager
|
|||||||
class UpdateKeyForm(forms.Form):
|
class UpdateKeyForm(forms.Form):
|
||||||
api_id = forms.CharField(max_length=254, required=True, label="Key ID")
|
api_id = forms.CharField(max_length=254, required=True, label="Key ID")
|
||||||
api_key = forms.CharField(max_length=254, required=True, label="Verification Code")
|
api_key = forms.CharField(max_length=254, required=True, label="Verification Code")
|
||||||
is_blue = forms.BooleanField(label="Blue to corp", required=False)
|
is_blue = forms.BooleanField(label="Blue to corp/alliance", required=False)
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
if EveManager.check_if_api_key_pair_exist(self.cleaned_data['api_id']):
|
if EveManager.check_if_api_key_pair_exist(self.cleaned_data['api_id']):
|
||||||
|
@ -104,7 +104,7 @@ def main_character_change(request, char_id):
|
|||||||
character_info = EveManager.get_character_by_id(char_id)
|
character_info = EveManager.get_character_by_id(char_id)
|
||||||
corporation_info = EveManager.get_corporation_info_by_id(character_info.corporation_id)
|
corporation_info = EveManager.get_corporation_info_by_id(character_info.corporation_id)
|
||||||
|
|
||||||
if EveManager.get_charater_corporation_id_by_id(char_id) == settings.CORP_ID:
|
if (settings.IS_CORP and EveManager.get_charater_corporation_id_by_id(char_id) == settings.CORP_ID) or (not settings.IS_CORP and EveManager.get_charater_alliance_id_by_id(char_id) == settings.ALLIANCE_ID):
|
||||||
add_member_permission(request.user, 'member')
|
add_member_permission(request.user, 'member')
|
||||||
add_user_to_group(request.user, settings.DEFAULT_AUTH_GROUP)
|
add_user_to_group(request.user, settings.DEFAULT_AUTH_GROUP)
|
||||||
add_user_to_group(request.user,
|
add_user_to_group(request.user,
|
||||||
|
@ -10,8 +10,11 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
<meta name="author" content="">
|
<meta name="author" content="">
|
||||||
|
{% if IS_CORP %}
|
||||||
<title>{{ CORP_NAME }} - Login</title>
|
<title>{{ CORP_NAME }} - Login</title>
|
||||||
|
{% else %}
|
||||||
|
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- Bootstrap Core CSS -->
|
<!-- Bootstrap Core CSS -->
|
||||||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
||||||
|
@ -10,7 +10,11 @@
|
|||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
<meta name="author" content="">
|
<meta name="author" content="">
|
||||||
|
|
||||||
<title>{{ CORP_NAME }} - Login</title>
|
{% if IS_CORP %}
|
||||||
|
<title>{{ CORP_NAME }} - Login</title>
|
||||||
|
{% else %}
|
||||||
|
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- Bootstrap Core CSS -->
|
<!-- Bootstrap Core CSS -->
|
||||||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
||||||
|
@ -23,12 +23,19 @@
|
|||||||
href="https://community.eveonline.com/support/api-key/CreatePredefined?accessMask=268435455">Create
|
href="https://community.eveonline.com/support/api-key/CreatePredefined?accessMask=268435455">Create
|
||||||
a full API key</a>
|
a full API key</a>
|
||||||
</p>
|
</p>
|
||||||
|
{% if IS_CORP %}
|
||||||
<p class="text-center">
|
<p class="text-center">
|
||||||
NOTE: If you are part of the corp do not check "Blue" this is for people who are blue to the
|
NOTE: If you are part of the corp do not check "Blue", this is for people who are blue to the
|
||||||
corp
|
corp
|
||||||
but are not in it. Blue access is limited.
|
but are not in it. Blue access is limited.
|
||||||
</p>
|
</p>
|
||||||
|
{% else %}
|
||||||
|
<p class="text-center">
|
||||||
|
NOTE: If you are part of the alliance do not check "Blue", this is for people who are blue to the
|
||||||
|
alliance
|
||||||
|
but are not in it. Blue access is limited.
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<p class="text-center"><b>Do not change the accessmask or deselect options or it will not work </b>
|
<p class="text-center"><b>Do not change the accessmask or deselect options or it will not work </b>
|
||||||
</p>
|
</p>
|
||||||
|
@ -67,7 +67,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p> Not part of the corporation</p>
|
{% if IS_CORP %}
|
||||||
|
<div class="alert alert-danger" role="alert">You are not in the corporation.</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="alert alert-danger" role="alert">You are not in the alliance.</div>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% extends "public/base.html" %}
|
{% extends "public/base.html" %}
|
||||||
{% block title %}Alliance Auth{% endblock %}
|
{% block title %}Alliance Auth{% endblock %}
|
||||||
{% block page_title %}Something something here{% endblock page_title %}
|
{% block page_title %}Dashboard{% endblock page_title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
@ -59,7 +59,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p> Not part of the corporation</p>
|
{% if IS_CORP %}
|
||||||
|
<p> Not part of the corporation.</p>
|
||||||
|
{% else %}
|
||||||
|
<p> Not part of the alliance.</p>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
@ -52,7 +52,11 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="alert alert-danger" role="alert">You are not in the corporation</div>
|
{% if IS_CORP %}
|
||||||
|
<div class="alert alert-danger" role="alert">You are not in the corporation.</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="alert alert-danger" role="alert">You are not in the alliance.</div>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -300,7 +300,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="alert alert-danger" role="alert">You are not in the corporation</div>
|
{% if IS_CORP %}
|
||||||
|
<div class="alert alert-danger" role="alert">You are not in the corporation.</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="alert alert-danger" role="alert">You are not in the alliance.</div>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -12,7 +12,11 @@
|
|||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
<meta name="author" content="">
|
<meta name="author" content="">
|
||||||
|
|
||||||
<title>{{ CORP_NAME }} - Login</title>
|
{% if IS_CORP %}
|
||||||
|
<title>{{ CORP_NAME }} - Login</title>
|
||||||
|
{% else %}
|
||||||
|
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- Bootstrap Core CSS -->
|
<!-- Bootstrap Core CSS -->
|
||||||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
||||||
|
@ -12,8 +12,11 @@
|
|||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
<meta name="author" content="">
|
<meta name="author" content="">
|
||||||
|
|
||||||
<title>{{ CORP_NAME }} - Login</title>
|
{% if IS_CORP %}
|
||||||
|
<title>{{ CORP_NAME }} - Login</title>
|
||||||
|
{% else %}
|
||||||
|
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||||
|
{% endif %}
|
||||||
<!-- Bootstrap Core CSS -->
|
<!-- Bootstrap Core CSS -->
|
||||||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
||||||
<!-- Custom Fonts -->
|
<!-- Custom Fonts -->
|
||||||
|
@ -12,7 +12,11 @@
|
|||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
<meta name="author" content="">
|
<meta name="author" content="">
|
||||||
|
|
||||||
<title>{{ CORP_NAME }} - Login</title>
|
{% if IS_CORP %}
|
||||||
|
<title>{{ CORP_NAME }} - Login</title>
|
||||||
|
{% else %}
|
||||||
|
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- Bootstrap Core CSS -->
|
<!-- Bootstrap Core CSS -->
|
||||||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
||||||
|
@ -2,13 +2,20 @@ from django.conf import settings
|
|||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
|
|
||||||
|
def is_corp(request):
|
||||||
|
return {'IS_CORP': settings.IS_CORP}
|
||||||
|
|
||||||
def corp_id(request):
|
def corp_id(request):
|
||||||
return {'CORP_ID': settings.CORP_ID}
|
return {'CORP_ID': settings.CORP_ID}
|
||||||
|
|
||||||
|
|
||||||
def corp_name(request):
|
def corp_name(request):
|
||||||
return {'CORP_NAME': settings.CORP_NAME}
|
return {'CORP_NAME': settings.CORP_NAME}
|
||||||
|
|
||||||
|
def alliance_id(request):
|
||||||
|
return {'ALLIANCE_ID': settings.ALLIANCE_ID}
|
||||||
|
|
||||||
|
def alliance_name(request):
|
||||||
|
return {'ALLIANCE_NAME': settings.CORP_NAME}
|
||||||
|
|
||||||
def jabber_url(request):
|
def jabber_url(request):
|
||||||
return {'JABBER_URL': settings.JABBER_URL}
|
return {'JABBER_URL': settings.JABBER_URL}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user