mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-11 21:40:17 +02:00
Merge pull request #5 from Adarnof/toggle
Incorporate corp/alliance toggle.
This commit is contained in:
commit
2b0a0dcde0
@ -20,6 +20,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
|
||||
|
||||
# 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@')
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
@ -77,8 +78,8 @@ DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'NAME': 'alliance_auth',
|
||||
'USER': os.environ.get('AA_DB_DEFAULT_USER', 'allianceauth'),
|
||||
'PASSWORD': os.environ.get('AA_DB_DEFAULT_PASSWORD', 'allianceauth'),
|
||||
'USER': os.environ.get('AA_DB_DEFAULT_USER', 'allianceserver'),
|
||||
'PASSWORD': os.environ.get('AA_DB_DEFAULT_PASSWORD', 'password'),
|
||||
'HOST': os.environ.get('AA_DB_DEFAULT_HOST', '127.0.0.1'),
|
||||
'PORT': os.environ.get('AA_DB_DEFAULT_PORT', '3306'),
|
||||
},
|
||||
@ -86,8 +87,8 @@ DATABASES = {
|
||||
'phpbb3': {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'NAME': 'alliance_forum',
|
||||
'USER': os.environ.get('AA_DB_PHPBB3_USER', 'allianceauth'),
|
||||
'PASSWORD': os.environ.get('AA_DB_PHPBB3_PASSWORD', 'allianceauth'),
|
||||
'USER': os.environ.get('AA_DB_PHPBB3_USER', 'allianceserver'),
|
||||
'PASSWORD': os.environ.get('AA_DB_PHPBB3_PASSWORD', 'password'),
|
||||
'HOST': os.environ.get('AA_DB_PHPBB3_HOST', '127.0.0.1'),
|
||||
'PORT': os.environ.get('AA_DB_PHPBB3_PORT', '3306'),
|
||||
},
|
||||
@ -95,8 +96,8 @@ DATABASES = {
|
||||
'mumble': {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'NAME': 'alliance_mumble',
|
||||
'USER': os.environ.get('AA_DB_MUMBLE_USER', 'alliancemumble'),
|
||||
'PASSWORD': os.environ.get('AA_DB_MUMBLE_PASSWORD', 'alliancemumble'),
|
||||
'USER': os.environ.get('AA_DB_MUMBLE_USER', 'allianceserver'),
|
||||
'PASSWORD': os.environ.get('AA_DB_MUMBLE_PASSWORD', 'password'),
|
||||
'HOST': os.environ.get('AA_DB_MUMBLE_HOST', '127.0.0.1'),
|
||||
'PORT': os.environ.get('AA_DB_MUMBLE_PORT', '3306'),
|
||||
}
|
||||
@ -111,6 +112,9 @@ TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
'django.core.context_processors.tz',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
'django.core.context_processors.request',
|
||||
'util.context_processors.is_corp',
|
||||
'util.context_processors.corp_id',
|
||||
'util.context_processors.corp_name',
|
||||
'util.context_processors.alliance_id',
|
||||
'util.context_processors.alliance_name',
|
||||
'util.context_processors.jabber_url',
|
||||
@ -150,17 +154,27 @@ STATIC_URL = '/static/'
|
||||
##
|
||||
#####################################################
|
||||
|
||||
###########################
|
||||
# ALLIANCE / CORP TOGGLE
|
||||
###########################
|
||||
# Specifies to run membership checks against corp or alliance
|
||||
# Set to FALSE for alliance
|
||||
# Set to TRUE for corp
|
||||
###########################
|
||||
IS_CORP = 'False' == os.environ.get('AA_IS_CORP', 'True')
|
||||
|
||||
|
||||
#################
|
||||
# EMAIL SETTINGS
|
||||
#################
|
||||
# DOMAIN - The alliance auth domain_url
|
||||
# EMAIL_HOST - SMTP Server URL
|
||||
# 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_USE_TLS - Set to use TLS encryption
|
||||
#################
|
||||
DOMAIN = os.environ.get('AA_DOMAIN', 'https://the99eve.com')
|
||||
DOMAIN = os.environ.get('AA_DOMAIN', 'https://yourdomain.com')
|
||||
EMAIL_HOST = os.environ.get('AA_EMAIL_HOST', 'smtp.gmail.com')
|
||||
EMAIL_PORT = int(os.environ.get('AA_EMAIL_PORT', '587'))
|
||||
EMAIL_HOST_USER = os.environ.get('AA_EMAIL_HOST_USER', '')
|
||||
@ -170,54 +184,66 @@ EMAIL_USE_TLS = 'True' == os.environ.get('AA_EMAIL_USE_TLS', 'True')
|
||||
#########################
|
||||
# Default Group Settings
|
||||
#########################
|
||||
# DEFAULT_ALLIANCE_GROUP - Default group alliance members are put in
|
||||
# DEFAULT_AUTH_GROUP - Default group members are put in
|
||||
# DEFAULT_BLUE_GROUP - Default group for blue members
|
||||
#########################
|
||||
DEFAULT_ALLIANCE_GROUP = os.environ.get('AA_DEFAULT_ALLIANCE_GROUP', 'AllianceMember')
|
||||
DEFAULT_BLUE_GROUP = os.environ.get('AA_DEFAULT_BLUE_GROUP', 'BlueMember')
|
||||
DEFAULT_AUTH_GROUP = os.environ.get('AA_DEFAULT_ALLIANCE_GROUP', 'Member')
|
||||
DEFAULT_BLUE_GROUP = os.environ.get('AA_DEFAULT_BLUE_GROUP', 'Blue')
|
||||
|
||||
#########################
|
||||
# Alliance Service Setup
|
||||
#########################
|
||||
# ENABLE_ALLIANCE_FORUM - Enable forum support in the auth for alliance members
|
||||
# ENABLE_ALLIANCE_JABBER - Enable jabber support in the auth for alliance members
|
||||
# ENABLE_ALLIANCE_MUMBLE - Enable mumble support in the auth for alliance members
|
||||
# ENABLE_ALLIANCE_IPBOARD - Enable IPBoard forum support in the auth for alliance members
|
||||
# ENABLE_AUTH_FORUM - Enable forum support in the auth for auth'd members
|
||||
# ENABLE_AUTH_JABBER - Enable jabber support in the auth for auth'd members
|
||||
# ENABLE_AUTH_MUMBLE - Enable mumble support in the auth for auth'd members
|
||||
# ENABLE_AUTH_IPBOARD - Enable IPBoard forum support in the auth for auth'd members
|
||||
#########################
|
||||
ENABLE_ALLIANCE_FORUM = 'True' == os.environ.get('AA_ENABLE_ALLIANCE_FORUM', 'True')
|
||||
ENABLE_ALLIANCE_JABBER = 'True' == os.environ.get('AA_ENABLE_ALLIANCE_JABBER', 'True')
|
||||
ENABLE_ALLIANCE_MUMBLE = 'True' == os.environ.get('AA_ENABLE_ALLIANCE_MUMBLE', 'True')
|
||||
ENABLE_ALLIANCE_IPBOARD = 'True' == os.environ.get('AA_ENABLE_ALLIANCE_IPBOARD', 'False')
|
||||
ENABLE_ALLIANCE_TEAMSPEAK3 = 'True' == os.environ.get('AA_ENABLE_ALLIANCE_TEAMSPEAK3', 'False')
|
||||
ENABLE_AUTH_FORUM = 'True' == os.environ.get('AA_ENABLE_AUTH_FORUM', 'True')
|
||||
ENABLE_AUTH_JABBER = 'True' == os.environ.get('AA_ENABLE_AUTH_JABBER', 'True')
|
||||
ENABLE_AUTH_MUMBLE = 'True' == os.environ.get('AA_ENABLE_AUTH_MUMBLE', 'True')
|
||||
ENABLE_AUTH_IPBOARD = 'True' == os.environ.get('AA_ENABLE_AUTH_IPBOARD', 'False')
|
||||
ENABLE_AUTH_TEAMSPEAK3 = 'True' == os.environ.get('AA_ENABLE_AUTH_TEAMSPEAK3', 'False')
|
||||
|
||||
#####################
|
||||
# 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_JABBER - Enable jabber 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
|
||||
#####################
|
||||
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_JABBER = 'True' == os.environ.get('AA_ENABLE_BLUE_JABBER', 'False')
|
||||
ENABLE_BLUE_MUMBLE = 'True' == os.environ.get('AA_ENABLE_BLUE_MUMBLE', 'True')
|
||||
ENABLE_BLUE_IPBOARD = 'True' == os.environ.get('AA_ENABLE_BLUE_IPBOARD', 'False')
|
||||
ENABLE_BLUE_TEAMSPEAK3 = 'True' == os.environ.get('AA_ENABLE_BLUE_TEAMSPEAK3', 'False')
|
||||
|
||||
#########################
|
||||
# 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_NAME - Set this to your Corporation Name
|
||||
# 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_ID = os.environ.get('AA_CORP_ID', '')
|
||||
CORP_NAME = os.environ.get('AA_CORP_NAME', '')
|
||||
CORP_API_ID = os.environ.get('AA_CORP_API_ID', '')
|
||||
CORP_API_VCODE = os.environ.get('AA_CORP_API_VCODE', '')
|
||||
|
||||
|
||||
#########################
|
||||
# Alliance Configuration
|
||||
#########################
|
||||
# ALLIANCE_ID - Set this to your AllianceID
|
||||
# ALLIANCE_ID - Set this to your Alliance ID (get this from https://zkillboard.com/alliance/#######)
|
||||
# ALLIANCE_NAME - Set this to your Alliance Name
|
||||
# ALLIANCE_EXEC_CORP_ID - Set this to the api id for the exec corp
|
||||
# ALLIANCE_EXEC_CORP_VCODE - Set this to the api vcode for the exe corp
|
||||
# ALLIANCE_BLUE_STANDING - The default lowest standings setting to consider blue
|
||||
########################
|
||||
ALLIANCE_ID = os.environ.get('AA_ALLIANCE_ID', '99001336')
|
||||
ALLIANCE_NAME = os.environ.get('AA_ALLIANCE_NAME', 'Somealliance')
|
||||
ALLIANCE_EXEC_CORP_ID = os.environ.get('AA_ALLIANCE_EXEC_CORP_ID', '')
|
||||
ALLIANCE_EXEC_CORP_VCODE = os.environ.get('AA_ALLIANCE_EXEC_CORP_VCODE', '')
|
||||
ALLIANCE_BLUE_STANDING = float(os.environ.get('AA_ALLIANCE_BLUE_STANDING', '5.0'))
|
||||
ALLIANCE_ID = os.environ.get('AA_ALLIANCE_ID', '')
|
||||
ALLIANCE_NAME = os.environ.get('AA_ALLIANCE_NAME', '')
|
||||
|
||||
|
||||
#####################
|
||||
# HR Configuration
|
||||
@ -235,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_APIMODULE - Module for alliance auth *leave alone*
|
||||
#####################
|
||||
FORUM_URL = os.environ.get('AA_FORUM_URL', "http://someaddress.com")
|
||||
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_APIKEY = os.environ.get('AA_IPBOARD_APIKEY', 'somekeyhere')
|
||||
IPBOARD_APIMODULE = 'aa'
|
||||
@ -246,15 +272,16 @@ IPBOARD_APIMODULE = 'aa'
|
||||
# JABBER_URL - Jabber address url
|
||||
# JABBER_PORT - Jabber service portal
|
||||
# JABBER_SERVER - Jabber server url
|
||||
# OPENFIRE_ADDRESS - Address of the openfire admin console
|
||||
# OPENFIRE_SECRET_KEY - Openfire userservice secret key
|
||||
# OPENFIRE_ADDRESS - Address of the openfire admin console including port
|
||||
# Please use http with 9090 or https with 9091
|
||||
# OPENFIRE_SECRET_KEY - Openfire REST API secret key
|
||||
# BROADCAST_USER - Broadcast user JID
|
||||
# BROADCAST_USER_PASSWORD - Broadcast user password
|
||||
######################
|
||||
JABBER_URL = os.environ.get('AA_JABBER_URL', "someaddress.com")
|
||||
JABBER_URL = os.environ.get('AA_JABBER_URL', "someurl.com")
|
||||
JABBER_PORT = int(os.environ.get('AA_JABBER_PORT', '5223'))
|
||||
JABBER_SERVER = os.environ.get('AA_JABBER_SERVER', "someadddress.com")
|
||||
OPENFIRE_ADDRESS = os.environ.get('AA_OPENFIRE_ADDRESS', "http://someaddress.com:9090/")
|
||||
JABBER_SERVER = os.environ.get('AA_JABBER_SERVER', "someurl.com")
|
||||
OPENFIRE_ADDRESS = os.environ.get('AA_OPENFIRE_ADDRESS', "http://someurl.com:9090")
|
||||
OPENFIRE_SECRET_KEY = os.environ.get('AA_OPENFIRE_SECRET_KEY', "somekey")
|
||||
BROADCAST_USER = os.environ.get('AA_BROADCAST_USER', "broadcast@") + JABBER_URL
|
||||
BROADCAST_USER_PASSWORD = os.environ.get('AA_BROADCAST_USER_PASSWORD', "somepassword")
|
||||
|
@ -13,7 +13,32 @@ from authentication.models import AuthServicesInfo
|
||||
from eveonline.managers import EveManager
|
||||
from services.managers.eve_api_manager import EveApiManager
|
||||
from util.common_task import deactivate_services
|
||||
from util import add_member_permission
|
||||
from util import remove_member_permission
|
||||
from util import check_if_user_has_permission
|
||||
from util.common_task import add_user_to_group
|
||||
from util.common_task import remove_user_from_group
|
||||
from util.common_task import generate_corp_group_name
|
||||
from eveonline.models import EveCharacter
|
||||
from eveonline.models import EveCorporationInfo
|
||||
from authentication.managers import AuthServicesInfoManager
|
||||
|
||||
def generate_corp_group_name(corpname):
|
||||
return 'Corp_' + corpname.replace(' ', '_')
|
||||
|
||||
def disable_alliance_member(user, char_id):
|
||||
remove_member_permission(user, 'member')
|
||||
remove_user_from_group(user, settings.DEFAULT_AUTH_GROUP)
|
||||
remove_user_from_group(user,
|
||||
generate_corp_group_name(
|
||||
EveManager.get_character_by_id(char_id).corporation_name))
|
||||
deactivate_services(user)
|
||||
|
||||
def disable_blue_member(user):
|
||||
remove_member_permission(user, 'blue_member')
|
||||
remove_user_from_group(user, settings.DEFAULT_BLUE_GROUP)
|
||||
deactivate_services(user)
|
||||
AuthServicesInfoManager.update_is_blue(False, user)
|
||||
|
||||
def update_jabber_groups(user):
|
||||
syncgroups = SyncGroupCache.objects.filter(user=user)
|
||||
@ -188,6 +213,8 @@ def run_api_refresh():
|
||||
print 'Running update on user: ' + user.username
|
||||
if authserviceinfo.main_char_id:
|
||||
if authserviceinfo.main_char_id != "":
|
||||
#preserve old corp ID for corp change test on members
|
||||
oldcorp_id = EveCharacter.objects.get(character_id=authserviceinfo.main_char_id).corporation_id
|
||||
for api_key_pair in api_key_pairs:
|
||||
print 'Running on ' + api_key_pair.api_id + ':' + api_key_pair.api_key
|
||||
if EveApiManager.api_key_is_valid(api_key_pair.api_id, api_key_pair.api_key):
|
||||
@ -204,49 +231,110 @@ def run_api_refresh():
|
||||
# Check our main character
|
||||
character = EveManager.get_character_by_id(authserviceinfo.main_char_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_alliance_id = EveManager.get_charater_alliance_id_by_id(authserviceinfo.main_char_id)
|
||||
if main_alliance_id == settings.ALLIANCE_ID:
|
||||
pass
|
||||
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"):
|
||||
#transition from none or blue to member
|
||||
if check_if_user_has_permission(user, "blue_member"):
|
||||
#strip blue status
|
||||
remove_member_permission(user, "blue_member")
|
||||
remove_user_from_group(user, settings.DEFAULT_BLUE_GROUP)
|
||||
AuthServicesInfoManager.update_is_blue(False, user)
|
||||
#add to auth group
|
||||
add_member_permission(user, "member")
|
||||
add_user_to_group(user, settings.DEFAULT_AUTH_GROUP)
|
||||
#add to required corp group
|
||||
add_user_to_group(user, generate_corp_group_name(character.corporation_name))
|
||||
elif corp.corporation_id != oldcorp_id:
|
||||
#changed corps, both corps auth'd, need to change group assignment
|
||||
oldcorp = EveCorporationInfo.objects.get(corporation_id=oldcorp_id)
|
||||
remove_user_from_group(user, generate_corp_group_name(oldcorp.corporation_name))
|
||||
add_user_to_group(user, generate_corp_group_name(character.corporation_name))
|
||||
#reset services to force new mumble names and group assignments
|
||||
deactivate_services(user)
|
||||
elif corp is not None:
|
||||
if corp.is_blue is not True:
|
||||
if check_if_user_has_permission(user, "member"):
|
||||
#transition from member to nobody
|
||||
disable_alliance_member(user, authserviceinfo.main_char_id)
|
||||
elif check_if_user_has_permission(user, "blue_member"):
|
||||
#transition from blue to nobody
|
||||
disable_blue_member(user)
|
||||
else:
|
||||
#stay nobody, make sure no services
|
||||
deactivate_services(user)
|
||||
else:
|
||||
if check_if_user_has_permission(user, "member"):
|
||||
#remove auth member to prepare for member to blue transition
|
||||
disable_alliance_member(user, authserviceinfo.main_char_id)
|
||||
if not check_if_user_has_permission(user, "blue_member"):
|
||||
#perform nobody to blue transition
|
||||
add_member_permission(user, "blue_member")
|
||||
add_user_to_group(user, settings.DEFAULT_BLUE_GROUP)
|
||||
AuthServicesInfoManager.update_is_blue(True, user)
|
||||
|
||||
else:
|
||||
# disable accounts with missing corp model (not blue or member)
|
||||
if check_if_user_has_permission(user, "member"):
|
||||
disable_alliance_member(user, authserviceinfo.main_char_id)
|
||||
elif check_if_user_has_permission(user, "blue_member"):
|
||||
disable_blue_member(user)
|
||||
else:
|
||||
deactivate_services(user)
|
||||
|
||||
else:
|
||||
# disable accounts with invalid keys
|
||||
if check_if_user_has_permission(user, "member"):
|
||||
disable_alliance_member(user, authserviceinfo.main_char_id)
|
||||
elif check_if_user_has_permission(user, "blue_member"):
|
||||
disable_blue_member(user)
|
||||
else:
|
||||
deactivate_services(user)
|
||||
else:
|
||||
# nuke it
|
||||
deactivate_services(user)
|
||||
|
||||
else:
|
||||
print 'No main_char_id set'
|
||||
|
||||
|
||||
# Run Every 2 hours
|
||||
@periodic_task(run_every=crontab(minute=0, hour="*/2"))
|
||||
def run_alliance_corp_update():
|
||||
def run_corp_update():
|
||||
# I am not proud of this block of code
|
||||
if EveApiManager.check_if_api_server_online():
|
||||
|
||||
# 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 settings.IS_CORP:
|
||||
# Create the corp
|
||||
corpinfo = EveApiManager.get_corporation_information(settings.CORP_ID)
|
||||
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)
|
||||
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
|
||||
#refer to https://github.com/eve-val/evelink/blob/master/evelink/parsing/contact_list.py#L43
|
||||
standing_level = 'alliance'
|
||||
if settings.IS_CORP:
|
||||
standing_level = 'corp'
|
||||
|
||||
# Create the corps in the standings
|
||||
alliance_standings = EveApiManager.get_alliance_standings()
|
||||
if alliance_standings:
|
||||
for standing_id in EveApiManager.get_alliance_standings()['alliance']:
|
||||
if int(alliance_standings['alliance'][standing_id]['standing']) >= settings.ALLIANCE_BLUE_STANDING:
|
||||
corp_standings = EveApiManager.get_corp_standings()
|
||||
if corp_standings:
|
||||
for standing_id in EveApiManager.get_corp_standings()[standing_level]:
|
||||
if int(corp_standings[standing_level][standing_id]['standing']) >= settings.BLUE_STANDING:
|
||||
if EveApiManager.check_if_id_is_character(standing_id):
|
||||
pass
|
||||
elif EveApiManager.check_if_id_is_corp(standing_id):
|
||||
@ -276,22 +364,16 @@ def run_alliance_corp_update():
|
||||
# Update all allinace info's
|
||||
for all_alliance_info in EveManager.get_all_alliance_info():
|
||||
all_alliance_api_info = EveApiManager.get_alliance_information(all_alliance_info.alliance_id)
|
||||
if all_alliance_info.alliance_id == settings.ALLIANCE_ID:
|
||||
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)
|
||||
else:
|
||||
if 'alliance' in alliance_standings:
|
||||
if int(all_alliance_info.alliance_id) in alliance_standings['alliance']:
|
||||
if int(alliance_standings['alliance'][int(all_alliance_info.alliance_id)][
|
||||
'standing']) >= settings.ALLIANCE_BLUE_STANDING:
|
||||
EveManager.update_alliance_info(all_alliance_api_info['id'],
|
||||
all_alliance_api_info['executor_id'],
|
||||
all_alliance_api_info['member_count'], True)
|
||||
else:
|
||||
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(corp_standings[standing_level][int(all_alliance_info.alliance_id)][
|
||||
'standing']) >= settings.BLUE_STANDING:
|
||||
EveManager.update_alliance_info(all_alliance_api_info['id'],
|
||||
all_alliance_api_info['executor_id'],
|
||||
all_alliance_api_info['member_count'], True)
|
||||
else:
|
||||
EveManager.update_alliance_info(all_alliance_api_info['id'],
|
||||
all_alliance_api_info['executor_id'],
|
||||
@ -300,6 +382,10 @@ def run_alliance_corp_update():
|
||||
EveManager.update_alliance_info(all_alliance_api_info['id'],
|
||||
all_alliance_api_info['executor_id'],
|
||||
all_alliance_api_info['member_count'], False)
|
||||
else:
|
||||
EveManager.update_alliance_info(all_alliance_api_info['id'],
|
||||
all_alliance_api_info['executor_id'],
|
||||
all_alliance_api_info['member_count'], False)
|
||||
|
||||
# Update corp infos
|
||||
for all_corp_info in EveManager.get_all_corporation_info():
|
||||
@ -310,46 +396,42 @@ def run_alliance_corp_update():
|
||||
|
||||
if alliance is not None and all_corp_info.alliance is not None:
|
||||
|
||||
if all_corp_info.alliance.alliance_id == settings.ALLIANCE_ID:
|
||||
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)
|
||||
else:
|
||||
if int(alliance.alliance_id) in alliance_standings['alliance']:
|
||||
if int(alliance_standings['alliance'][int(alliance.alliance_id)][
|
||||
'standing']) >= settings.ALLIANCE_BLUE_STANDING:
|
||||
EveManager.update_corporation_info(corpinfo['id'], corpinfo['members']['current'], alliance,
|
||||
True)
|
||||
else:
|
||||
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)][
|
||||
'standing']) >= settings.BLUE_STANDING:
|
||||
EveManager.update_corporation_info(corpinfo['id'], corpinfo['members']['current'], alliance,
|
||||
True)
|
||||
else:
|
||||
EveManager.update_corporation_info(corpinfo['id'], corpinfo['members']['current'], alliance,
|
||||
False)
|
||||
else:
|
||||
EveManager.update_corporation_info(corpinfo['id'], corpinfo['members']['current'], alliance,
|
||||
False)
|
||||
else:
|
||||
if int(all_corp_info.corporation_id) in alliance_standings['alliance']:
|
||||
if int(alliance_standings['alliance'][int(all_corp_info.corporation_id)][
|
||||
'standing']) >= settings.ALLIANCE_BLUE_STANDING:
|
||||
if int(all_corp_info.corporation_id) in corp_standings[standing_level]:
|
||||
if int(corp_standings[standing_level][int(all_corp_info.corporation_id)][
|
||||
'standing']) >= settings.BLUE_STANDING:
|
||||
EveManager.update_corporation_info(corpinfo['id'], corpinfo['members']['current'], None, True)
|
||||
else:
|
||||
EveManager.update_corporation_info(corpinfo['id'], corpinfo['members']['current'], None, False)
|
||||
else:
|
||||
EveManager.update_corporation_info(corpinfo['id'], corpinfo['members']['current'], None, False)
|
||||
|
||||
# Nuke the none believers
|
||||
# Remove irrelevent corp and alliance models
|
||||
# Check the corps
|
||||
for all_corp_info in EveManager.get_all_corporation_info():
|
||||
if all_corp_info.alliance is not None:
|
||||
if all_corp_info.alliance.alliance_id is not None:
|
||||
if all_corp_info.alliance.alliance_id != settings.ALLIANCE_ID:
|
||||
if not all_corp_info.is_blue:
|
||||
all_corp_info.delete()
|
||||
else:
|
||||
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:
|
||||
all_corp_info.delete()
|
||||
|
||||
# Check the alliances
|
||||
for all_alliance_info in EveManager.get_all_alliance_info():
|
||||
if all_alliance_info.alliance_id != settings.ALLIANCE_ID:
|
||||
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:
|
||||
all_alliance_info.delete()
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@ from eveonline.managers import EveManager
|
||||
class UpdateKeyForm(forms.Form):
|
||||
api_id = forms.CharField(max_length=254, required=True, label="Key ID")
|
||||
api_key = forms.CharField(max_length=254, required=True, label="Verification Code")
|
||||
is_blue = forms.BooleanField(label="Blue to alliance", required=False)
|
||||
is_blue = forms.BooleanField(label="Blue to corp/alliance", required=False)
|
||||
|
||||
def clean(self):
|
||||
if EveManager.check_if_api_key_pair_exist(self.cleaned_data['api_id']):
|
||||
@ -28,4 +28,4 @@ class UpdateKeyForm(forms.Form):
|
||||
self.cleaned_data['api_key']):
|
||||
raise forms.ValidationError(u'API supplied is not a full api key')
|
||||
|
||||
return self.cleaned_data
|
||||
return self.cleaned_data
|
||||
|
@ -205,4 +205,9 @@ class EveManager:
|
||||
|
||||
@staticmethod
|
||||
def get_all_alliance_info():
|
||||
return EveAllianceInfo.objects.all()
|
||||
return EveAllianceInfo.objects.all()
|
||||
|
||||
@staticmethod
|
||||
def get_charater_corporation_id_by_id(char_id):
|
||||
if EveCharacter.objects.filter(character_id=char_id).exists():
|
||||
return EveCharacter.objects.get(character_id=char_id).corporation_id
|
||||
|
@ -22,9 +22,9 @@ from eveonline.models import EveApiKeyPair
|
||||
from authentication.models import AuthServicesInfo
|
||||
|
||||
|
||||
def disable_alliance_member(user, char_id):
|
||||
remove_member_permission(user, 'alliance_member')
|
||||
remove_user_from_group(user, settings.DEFAULT_ALLIANCE_GROUP)
|
||||
def disable_member(user, char_id):
|
||||
remove_member_permission(user, 'member')
|
||||
remove_user_from_group(user, settings.DEFAULT_AUTH_GROUP)
|
||||
remove_user_from_group(user,
|
||||
generate_corp_group_name(
|
||||
EveManager.get_character_by_id(char_id).corporation_name))
|
||||
@ -80,7 +80,7 @@ def api_key_removal(request, api_id):
|
||||
if authinfo.is_blue:
|
||||
disable_blue_member(request.user)
|
||||
else:
|
||||
disable_alliance_member(request.user, authinfo.main_char_id)
|
||||
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)
|
||||
@ -104,9 +104,9 @@ def main_character_change(request, char_id):
|
||||
character_info = EveManager.get_character_by_id(char_id)
|
||||
corporation_info = EveManager.get_corporation_info_by_id(character_info.corporation_id)
|
||||
|
||||
if EveManager.get_charater_alliance_id_by_id(char_id) == settings.ALLIANCE_ID:
|
||||
add_member_permission(request.user, 'alliance_member')
|
||||
add_user_to_group(request.user, settings.DEFAULT_ALLIANCE_GROUP)
|
||||
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_user_to_group(request.user, settings.DEFAULT_AUTH_GROUP)
|
||||
add_user_to_group(request.user,
|
||||
generate_corp_group_name(EveManager.get_character_by_id(char_id).corporation_name))
|
||||
|
||||
@ -116,15 +116,15 @@ def main_character_change(request, char_id):
|
||||
add_user_to_group(request.user, settings.DEFAULT_BLUE_GROUP)
|
||||
AuthServicesInfoManager.update_is_blue(True, request.user)
|
||||
else:
|
||||
if check_if_user_has_permission(request.user, 'alliance_member'):
|
||||
disable_alliance_member(request.user, previousmainid)
|
||||
if check_if_user_has_permission(request.user, 'member'):
|
||||
disable_member(request.user, previousmainid)
|
||||
|
||||
if check_if_user_has_permission(request.user, 'blue_member'):
|
||||
disable_blue_member(request.user)
|
||||
else:
|
||||
# TODO: disable serivces
|
||||
if check_if_user_has_permission(request.user, 'alliance_member'):
|
||||
disable_alliance_member(request.user, previousmainid)
|
||||
if check_if_user_has_permission(request.user, 'member'):
|
||||
disable_member(request.user, previousmainid)
|
||||
|
||||
if check_if_user_has_permission(request.user, 'blue_member'):
|
||||
disable_blue_member(request.user)
|
||||
|
@ -96,7 +96,7 @@ def groups_view(request):
|
||||
# Check if group is a corp
|
||||
if "Corp_" in group.name:
|
||||
pass
|
||||
elif settings.DEFAULT_ALLIANCE_GROUP in group.name:
|
||||
elif settings.DEFAULT_AUTH_GROUP in group.name:
|
||||
pass
|
||||
elif settings.DEFAULT_BLUE_GROUP in group.name:
|
||||
pass
|
||||
@ -146,4 +146,4 @@ def group_request_leave(request, group_id):
|
||||
grouprequest.leave_request = True
|
||||
grouprequest.save()
|
||||
|
||||
return HttpResponseRedirect("/groups")
|
||||
return HttpResponseRedirect("/groups")
|
||||
|
@ -3,13 +3,17 @@ from django.conf import settings
|
||||
|
||||
from eveonline.models import EveCorporationInfo
|
||||
|
||||
|
||||
class HRApplicationForm(forms.Form):
|
||||
allchoices = []
|
||||
for corp in EveCorporationInfo.objects.all():
|
||||
if corp.alliance is not None:
|
||||
if corp.alliance.alliance_id == settings.ALLIANCE_ID:
|
||||
allchoices.append((str(corp.corporation_id), str(corp.corporation_name)))
|
||||
|
||||
if settings.IS_CORP:
|
||||
corp = EveCorporationInfo.objects.get(corporation_id=settings.CORP_ID)
|
||||
allchoices.append((str(corp.corporation_id), str(corp.corporation_name)))
|
||||
else:
|
||||
for corp in EveCorporationInfo.objects.all():
|
||||
if corp.alliance is not None:
|
||||
if corp.alliance.alliance_id == settings.ALLIANCE_ID:
|
||||
allchoices.append((str(corp.corporation_id), str(corp.corporation_name)))
|
||||
|
||||
character_name = forms.CharField(max_length=254, required=True, label="Main Character Name")
|
||||
full_api_id = forms.CharField(max_length=254, required=True, label="API ID")
|
||||
@ -26,4 +30,4 @@ class HRApplicationCommentForm(forms.Form):
|
||||
|
||||
|
||||
class HRApplicationSearchForm(forms.Form):
|
||||
search_string = forms.CharField(max_length=254, required=True, label="Search String")
|
||||
search_string = forms.CharField(max_length=254, required=True, label="Search String")
|
||||
|
@ -1,8 +1,8 @@
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from eveonline.models import EveCorporationInfo
|
||||
from eveonline.models import EveCharacter
|
||||
from eveonline.models import EveCorporationInfo
|
||||
|
||||
|
||||
class HRApplication(models.Model):
|
||||
@ -33,4 +33,4 @@ class HRApplicationComment(models.Model):
|
||||
commenter_character = models.ForeignKey(EveCharacter)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.application.character_name) + " - Comment"
|
||||
return str(self.application.character_name) + " - Comment"
|
||||
|
@ -28,11 +28,11 @@ def hr_application_management_view(request):
|
||||
# Get the corp the member is in
|
||||
auth_info = AuthServicesInfo.objects.get(user=request.user)
|
||||
if auth_info.main_char_id != "":
|
||||
main_alliance_id = EveManager.get_charater_alliance_id_by_id(auth_info.main_char_id)
|
||||
if main_alliance_id == settings.ALLIANCE_ID:
|
||||
main_corp_id = EveManager.get_charater_corporation_id_by_id(auth_info.main_char_id)
|
||||
if main_corp_id == settings.CORP_ID:
|
||||
main_char = EveCharacter.objects.get(character_id=auth_info.main_char_id)
|
||||
corp = EveCorporationInfo.objects.get(corporation_id=main_char.corporation_id)
|
||||
corp_applications = HRApplication.objects.filter(corp=corp).filter(approved_denied=None)
|
||||
corp_applications = HRApplication.objects.filter(approved_denied=None)
|
||||
else:
|
||||
corp_applications = None
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
from util import bootstrap_permissions
|
||||
from celerytask.tasks import run_alliance_corp_update
|
||||
from celerytask.tasks import run_corp_update
|
||||
|
||||
bootstrap_permissions()
|
||||
run_alliance_corp_update()
|
||||
run_corp_update()
|
||||
quit()
|
||||
|
@ -140,10 +140,10 @@ class EveApiManager():
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def get_alliance_standings():
|
||||
if settings.ALLIANCE_EXEC_CORP_ID != "":
|
||||
def get_corp_standings():
|
||||
if settings.CORP_API_ID != "":
|
||||
try:
|
||||
api = evelink.api.API(api_key=(settings.ALLIANCE_EXEC_CORP_ID, settings.ALLIANCE_EXEC_CORP_VCODE))
|
||||
api = evelink.api.API(api_key=(settings.CORP_API_ID, settings.CORP_API_VCODE))
|
||||
corp = evelink.corp.Corp(api=api)
|
||||
corpinfo = corp.contacts()
|
||||
results = corpinfo[0]
|
||||
@ -178,4 +178,4 @@ class EveApiManager():
|
||||
except evelink.api.APIError as error:
|
||||
return False
|
||||
|
||||
return False
|
||||
return False
|
||||
|
@ -127,7 +127,7 @@ class Teamspeak3Manager:
|
||||
|
||||
server_groups = Teamspeak3Manager._group_list()
|
||||
|
||||
if not settings.DEFAULT_ALLIANCE_GROUP in server_groups:
|
||||
if not settings.DEFAULT_AUTH_GROUP in server_groups:
|
||||
Teamspeak3Manager._create_group(settings.DEFAULT_ALLIANCE_GROUP)
|
||||
|
||||
alliance_group_id = Teamspeak3Manager._group_id_by_name(settings.DEFAULT_ALLIANCE_GROUP)
|
||||
|
@ -91,7 +91,7 @@ def services_view(request):
|
||||
|
||||
|
||||
def service_blue_alliance_test(user):
|
||||
return check_if_user_has_permission(user, 'alliance_member') or check_if_user_has_permission(user, 'blue_member')
|
||||
return check_if_user_has_permission(user, 'member') or check_if_user_has_permission(user, 'blue_member')
|
||||
|
||||
|
||||
@login_required
|
||||
|
@ -18,7 +18,7 @@ from form import SrpFleetMainUpdateForm
|
||||
|
||||
|
||||
def srp_util_test(user):
|
||||
return check_if_user_has_permission(user, 'alliance_member') or check_if_user_has_permission(user, 'blue_member')
|
||||
return check_if_user_has_permission(user, 'member') or check_if_user_has_permission(user, 'blue_member')
|
||||
|
||||
|
||||
@login_required
|
||||
@ -273,4 +273,4 @@ def srp_fleet_edit_view(request, fleet_id):
|
||||
render_items = {'form': form, "no_fleet_id": no_fleet_id}
|
||||
|
||||
return render_to_response('registered/srpfleetupdate.html', render_items,
|
||||
context_instance=RequestContext(request))
|
||||
context_instance=RequestContext(request))
|
||||
|
@ -36,7 +36,7 @@
|
||||
<div class="navbar-header ">
|
||||
<a class="navbar-brand ">
|
||||
<div class="fa fa-cog fa-spin"></div>
|
||||
{{ ALLIANCE_NAME }}
|
||||
{{ CORP_NAME }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
class="fa fa-users fa-fw grayiconecolor"></i> Characters</a>
|
||||
</li>
|
||||
|
||||
{% if perms.auth.alliance_member %}
|
||||
{% if perms.auth.member %}
|
||||
<li>
|
||||
<a {% ifequal request.path "/groups/" %} class="active" {% endifequal %}
|
||||
href="{% url 'auth_groups' %}"><i
|
||||
@ -94,7 +94,7 @@
|
||||
<li class="text-center divider-horizontal">
|
||||
<h5>Aux Navigation</h5>
|
||||
</li>
|
||||
{% if perms.auth.alliance_member or perms.auth.blue_member %}
|
||||
{% if perms.auth.member or perms.auth.blue_member %}
|
||||
<li>
|
||||
<a {% ifequal request.path "/services/" %} class="active" {% endifequal %}
|
||||
href="{% url 'auth_services' %}"><i
|
||||
@ -102,7 +102,7 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if not perms.auth.alliance_member and not perms.auth.blue_member or perms.auth.human_resources %}
|
||||
{% if not perms.auth.member and not perms.auth.blue_member or perms.auth.human_resources %}
|
||||
<li>
|
||||
<a {% ifequal request.path "/hr_application_management/" %}
|
||||
class="active" {% endifequal %}
|
||||
@ -127,7 +127,7 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if perms.auth.alliance_member or perms.auth.blue_member %}
|
||||
{% if perms.auth.member or perms.auth.blue_member %}
|
||||
<li>
|
||||
<a {% ifequal request.path "/fits" %} class="active" {% endifequal %}
|
||||
href="{% url 'auth_fleet_fits' %}"><i
|
||||
@ -158,7 +158,7 @@
|
||||
class="fa fa-lock fa-fw grayiconecolor"></i>Change Password</a>
|
||||
</li>
|
||||
|
||||
{% if perms.auth.alliance_member or perms.auth.blue_member %}
|
||||
{% if perms.auth.member or perms.auth.blue_member %}
|
||||
<li>
|
||||
<a {% ifequal request.path "/tool/fleet_formatter_tool/" %}
|
||||
class="active" {% endifequal %}
|
||||
|
@ -10,9 +10,12 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||
|
||||
{% if IS_CORP %}
|
||||
<title>{{ CORP_NAME }} - Login</title>
|
||||
{% else %}
|
||||
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||
{% endif %}
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
<!-- Custom Fonts -->
|
||||
|
@ -10,7 +10,11 @@
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||
{% if IS_CORP %}
|
||||
<title>{{ CORP_NAME }} - Login</title>
|
||||
{% else %}
|
||||
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||
{% endif %}
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<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
|
||||
a full API key</a>
|
||||
</p>
|
||||
|
||||
<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>
|
||||
{% if IS_CORP %}
|
||||
<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
|
||||
corp
|
||||
but are not in it. Blue access is limited.
|
||||
</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>
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">Corporation Stats</h1>
|
||||
{% if perms.auth.alliance_member %}
|
||||
{% if perms.auth.member %}
|
||||
<div class="col-lg-12 container" id="example">
|
||||
|
||||
<div class="row">
|
||||
@ -67,7 +67,11 @@
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<p> Not part of the alliance</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 %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
@ -1,12 +1,12 @@
|
||||
{% extends "public/base.html" %}
|
||||
{% block title %}Alliance Auth{% endblock %}
|
||||
{% block page_title %}Something something here{% endblock page_title %}
|
||||
{% block page_title %}Dashboard{% endblock page_title %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">Dashboard</h1>
|
||||
{% if perms.auth.alliance_member %}
|
||||
{% if perms.auth.member %}
|
||||
<div class="col-lg-12 container" id="example">
|
||||
|
||||
|
||||
@ -59,7 +59,11 @@
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<p> Not part of the alliance</p>
|
||||
{% if IS_CORP %}
|
||||
<p> Not part of the corporation.</p>
|
||||
{% else %}
|
||||
<p> Not part of the alliance.</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
19
templates/registered/fleetfits.html
Normal file
19
templates/registered/fleetfits.html
Normal file
@ -0,0 +1,19 @@
|
||||
{% extends "public/base.html" %}
|
||||
{% load bootstrap %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block title %}Alliance Auth{% endblock %}
|
||||
|
||||
{% block page_title %}Alliance Fleet Doctrines{% endblock page_title %}
|
||||
{% block extra_css %}{% endblock extra_css %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
Main bash/defense doctrine (SHIELD) <br />
|
||||
<a href="javascript:CCPEVE.showFitting('17843:24427;1:12346;2:3841;2:2281;1:5975;1:33824;2:2048;1:3888;1:4405;2:31718;1:31796;2:28215;5:23025;12136::');" '="">Vexor Navy Issue</a><br />
|
||||
<a href="javascript:CCPEVE.showFitting('12005:24427;1:16471;1:2889;2:5975;1:3841;2:2281;1:2553;1:2048;1:33824;2:4405;2:31796;2:28213;5:28215;10:21898;1000::');" '="">Ishtar</a><br />
|
||||
<a href="javascript:CCPEVE.showFitting('11978:8641;3:24427;1:5975;1:2281;2:3841;1:8529;1:1541;2:1355;1:1447;1:31378;2:2488;3:23709;3::');" '="">Scimitar</a><br />
|
||||
<a href="javascript:CCPEVE.showFitting('631:8585;3:3841;1:2281;1:2032;1:5975;1:20224;1:2048;1:1447;4:31718;1:31790;1:31360;1::');" '="">Scythe</a><br />
|
||||
<br />
|
||||
Ship DNA can be exported by different tools I recommend using fleetup.com OR https://www.fuzzwork.co.uk/ships/dnagen.php to get the Ship DNA
|
||||
{% endblock content %}
|
@ -9,7 +9,7 @@
|
||||
{% block content %}
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">Available Groups</h1>
|
||||
{% if perms.auth.alliance_member %}
|
||||
{% if perms.auth.member %}
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th class="text-center">GroupID</th>
|
||||
@ -52,7 +52,11 @@
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="alert alert-danger" role="alert">You are not in the alliance</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 %}
|
||||
</div>
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="col-lg-12">
|
||||
{% if not perms.auth.alliance_member %}
|
||||
{% if not perms.auth.member %}
|
||||
<h1 class="page-header text-center">Personal Applications
|
||||
<div class="text-right">
|
||||
<a href="{% url 'auth_hrapplication_create_view' %}">
|
||||
|
@ -153,7 +153,7 @@
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
{% elif perms.auth.alliance_member %}
|
||||
{% elif perms.auth.member %}
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th class="text-center">Service</th>
|
||||
@ -162,7 +162,7 @@
|
||||
<th class="text-center">Domain</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
{% if ENABLE_ALLIANCE_FORUM %}
|
||||
{% if ENABLE_AUTH_FORUM %}
|
||||
<tr>
|
||||
<td class="text-center">Forums</td>
|
||||
<td class="text-center">{{ authinfo.forum_username }}</td>
|
||||
@ -187,7 +187,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if ENABLE_ALLIANCE_IPBOARD %}
|
||||
{% if ENABLE_AUTH_IPBOARD %}
|
||||
<td class="text-center">IPBoard Forums</td>
|
||||
<td class="text-center">{{ authinfo.ipboard_username }}</td>
|
||||
<td class="text-center">{{ authinfo.ipboard_password }}</td>
|
||||
@ -210,7 +210,7 @@
|
||||
{% endifequal %}
|
||||
</td>
|
||||
{% endif %}
|
||||
{% if ENABLE_ALLIANCE_JABBER %}
|
||||
{% if ENABLE_AUTH_JABBER %}
|
||||
<tr>
|
||||
<td class="text-center">Jabber</td>
|
||||
<td class="text-center">{{ authinfo.jabber_username }}</td>
|
||||
@ -235,7 +235,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if ENABLE_ALLIANCE_MUMBLE %}
|
||||
{% if ENABLE_AUTH_MUMBLE %}
|
||||
<tr>
|
||||
<td class="text-center">Mumble</td>
|
||||
<td class="text-center">{{ authinfo.mumble_username }}</td>
|
||||
@ -260,7 +260,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if ENABLE_ALLIANCE_TEAMSPEAK3 %}
|
||||
{% if ENABLE_AUTH_TEAMSPEAK3 %}
|
||||
<tr>
|
||||
<th class="text-center">Service</th>
|
||||
<th class="text-center">Unique ID</th>
|
||||
@ -300,7 +300,11 @@
|
||||
{% endif %}
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="alert alert-danger" role="alert">You are not in the alliance</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 %}
|
||||
</div>
|
||||
|
||||
|
@ -12,7 +12,11 @@
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||
{% if IS_CORP %}
|
||||
<title>{{ CORP_NAME }} - Login</title>
|
||||
{% else %}
|
||||
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||
{% endif %}
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
|
@ -12,8 +12,11 @@
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||
|
||||
{% if IS_CORP %}
|
||||
<title>{{ CORP_NAME }} - Login</title>
|
||||
{% else %}
|
||||
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||
{% endif %}
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
<!-- Custom Fonts -->
|
||||
|
@ -12,7 +12,7 @@
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||
<title>{{ CORP_NAME }} - Login</title>
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
|
@ -4,12 +4,12 @@
|
||||
|
||||
{% trans "Please go to the following page and choose a new password:" %}
|
||||
{% block reset_link %}
|
||||
https://the99eve.com{% url 'password_reset_confirm' uidb64=uid token=token %}
|
||||
https://someurl.com{% url 'password_reset_confirm' uidb64=uid token=token %}
|
||||
{% endblock %}
|
||||
{% trans "Your username, in case you've forgotten:" %} {{ user.get_username }}
|
||||
|
||||
{% trans "Thanks for using our site!" %}
|
||||
|
||||
{% blocktrans %}The The 99 Percent team{% endblocktrans %}
|
||||
{% blocktrans %}Your Corporation{% endblocktrans %}
|
||||
|
||||
{% endautoescape %}
|
||||
|
@ -12,7 +12,11 @@
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||
{% if IS_CORP %}
|
||||
<title>{{ CORP_NAME }} - Login</title>
|
||||
{% else %}
|
||||
<title>{{ ALLIANCE_NAME }} - Login</title>
|
||||
{% endif %}
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet">
|
||||
|
@ -15,7 +15,7 @@ from models import Timer
|
||||
|
||||
|
||||
def timer_util_test(user):
|
||||
return check_if_user_has_permission(user, 'alliance_member') or check_if_user_has_permission(user, 'blue_member')
|
||||
return check_if_user_has_permission(user, 'member') or check_if_user_has_permission(user, 'blue_member')
|
||||
|
||||
|
||||
@login_required
|
||||
@ -74,4 +74,4 @@ def remove_timer(request, timer_id):
|
||||
if Timer.objects.filter(id=timer_id).exists():
|
||||
timer = Timer.objects.get(id=timer_id)
|
||||
timer.delete()
|
||||
return HttpResponseRedirect("/timers/")
|
||||
return HttpResponseRedirect("/timers/")
|
||||
|
@ -9,7 +9,7 @@ from django.conf import settings
|
||||
|
||||
def bootstrap_permissions():
|
||||
ct = ContentType.objects.get_for_model(User)
|
||||
Permission.objects.get_or_create(codename="alliance_member", content_type=ct, name="alliance_member")
|
||||
Permission.objects.get_or_create(codename="member", content_type=ct, name="member")
|
||||
Permission.objects.get_or_create(codename="group_management", content_type=ct, name="group_management")
|
||||
Permission.objects.get_or_create(codename="jabber_broadcast", content_type=ct, name="jabber_broadcast")
|
||||
Permission.objects.get_or_create(codename="human_resources", content_type=ct, name="human_resources")
|
||||
@ -17,7 +17,7 @@ def bootstrap_permissions():
|
||||
Permission.objects.get_or_create(codename="corp_stats", content_type=ct, name="corp_stats")
|
||||
Permission.objects.get_or_create(codename="timer_management", content_type=ct, name="timer_management")
|
||||
Permission.objects.get_or_create(codename="srp_management", content_type=ct, name="srp_management")
|
||||
Group.objects.get_or_create(name=settings.DEFAULT_ALLIANCE_GROUP)
|
||||
Group.objects.get_or_create(name=settings.DEFAULT_AUTH_GROUP)
|
||||
Group.objects.get_or_create(name=settings.DEFAULT_BLUE_GROUP)
|
||||
|
||||
|
||||
@ -54,4 +54,4 @@ def random_string(string_length=10):
|
||||
random = str(uuid.uuid4()) # Convert UUID format to a Python string.
|
||||
random = random.upper() # Make all characters uppercase.
|
||||
random = random.replace("-", "") # Remove the UUID '-'.
|
||||
return random[0:string_length] # Return the random string.
|
||||
return random[0:string_length] # Return the random string.
|
||||
|
@ -2,13 +2,20 @@ from django.conf import settings
|
||||
from django.utils import timezone
|
||||
|
||||
|
||||
def is_corp(request):
|
||||
return {'IS_CORP': settings.IS_CORP}
|
||||
|
||||
def corp_id(request):
|
||||
return {'CORP_ID': settings.CORP_ID}
|
||||
|
||||
def corp_name(request):
|
||||
return {'CORP_NAME': settings.CORP_NAME}
|
||||
|
||||
def alliance_id(request):
|
||||
return {'ALLIANCE_ID': settings.ALLIANCE_ID}
|
||||
|
||||
|
||||
def alliance_name(request):
|
||||
return {'ALLIANCE_NAME': settings.ALLIANCE_NAME}
|
||||
|
||||
return {'ALLIANCE_NAME': settings.CORP_NAME}
|
||||
|
||||
def jabber_url(request):
|
||||
return {'JABBER_URL': settings.JABBER_URL}
|
||||
@ -17,11 +24,11 @@ def jabber_url(request):
|
||||
def domain_url(request):
|
||||
return {'DOMAIN': settings.DOMAIN, 'MUMBLE_URL': settings.MUMBLE_URL,
|
||||
'FORUM_URL': settings.FORUM_URL,
|
||||
'ENABLE_ALLIANCE_FORUM': settings.ENABLE_ALLIANCE_FORUM,
|
||||
'ENABLE_ALLIANCE_JABBER': settings.ENABLE_ALLIANCE_JABBER,
|
||||
'ENABLE_ALLIANCE_MUMBLE': settings.ENABLE_ALLIANCE_MUMBLE,
|
||||
'ENABLE_ALLIANCE_IPBOARD': settings.ENABLE_ALLIANCE_IPBOARD,
|
||||
'ENABLE_ALLIANCE_TEAMSPEAK3': settings.ENABLE_ALLIANCE_TEAMSPEAK3,
|
||||
'ENABLE_AUTH_FORUM': settings.ENABLE_AUTH_FORUM,
|
||||
'ENABLE_AUTH_JABBER': settings.ENABLE_AUTH_JABBER,
|
||||
'ENABLE_AUTH_MUMBLE': settings.ENABLE_AUTH_MUMBLE,
|
||||
'ENABLE_AUTH_IPBOARD': settings.ENABLE_AUTH_IPBOARD,
|
||||
'ENABLE_AUTH_TEAMSPEAK3': settings.ENABLE_AUTH_TEAMSPEAK3,
|
||||
'ENABLE_BLUE_JABBER': settings.ENABLE_BLUE_JABBER,
|
||||
'ENABLE_BLUE_FORUM': settings.ENABLE_BLUE_FORUM,
|
||||
'ENABLE_BLUE_MUMBLE': settings.ENABLE_BLUE_MUMBLE,
|
||||
@ -29,4 +36,4 @@ def domain_url(request):
|
||||
'ENABLE_BLUE_TEAMSPEAK3': settings.ENABLE_BLUE_TEAMSPEAK3,
|
||||
'TEAMSPEAK3_PUBLIC_URL': settings.TEAMSPEAK3_PUBLIC_URL,
|
||||
'JACK_KNIFE_URL': settings.JACK_KNIFE_URL,
|
||||
'CURRENT_UTC_TIME': timezone.now()}
|
||||
'CURRENT_UTC_TIME': timezone.now()}
|
||||
|
Loading…
x
Reference in New Issue
Block a user