mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-11 21:40:17 +02:00
Merge branch 'master' of https://github.com/R4stl1n/allianceauth
This commit is contained in:
commit
43eeee503f
@ -40,6 +40,7 @@ def login_user(request):
|
|||||||
|
|
||||||
def logout_user(request):
|
def logout_user(request):
|
||||||
logger.debug("logout_user called by user %s" % request.user)
|
logger.debug("logout_user called by user %s" % request.user)
|
||||||
|
logoutUser = request.user
|
||||||
logout(request)
|
logout(request)
|
||||||
logger.info("Successful logout for user %s" % request.user)
|
logger.info("Successful logout for user %s" % logoutUser)
|
||||||
return HttpResponseRedirect("/")
|
return HttpResponseRedirect("/")
|
||||||
|
@ -490,8 +490,6 @@ def run_api_refresh():
|
|||||||
logger.info("User %s main character id %s missing model. Clearning main character." % (user, authserviceinfo.main_char_id))
|
logger.info("User %s main character id %s missing model. Clearning main character." % (user, authserviceinfo.main_char_id))
|
||||||
authserviceinfo.main_char_id = ''
|
authserviceinfo.main_char_id = ''
|
||||||
authserviceinfo.save()
|
authserviceinfo.save()
|
||||||
else:
|
|
||||||
logger.warn("User %s has no main character id, unable to validate membership.")
|
|
||||||
set_state(user)
|
set_state(user)
|
||||||
|
|
||||||
|
|
||||||
|
@ -287,11 +287,11 @@ class EveApiManager():
|
|||||||
def validate_member_api(api_id, api_key):
|
def validate_member_api(api_id, api_key):
|
||||||
if settings.MEMBER_API_ACCOUNT:
|
if settings.MEMBER_API_ACCOUNT:
|
||||||
if EveApiManager.check_api_is_type_account(api_id, api_key) is not True:
|
if EveApiManager.check_api_is_type_account(api_id, api_key) is not True:
|
||||||
logger.debug("Api id %s is not type account as required for members - failed validation." % api_id)
|
logger.info("Api id %s is not type account as required for members - failed validation." % api_id)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if EveApiManager.check_api_is_full(api_id, api_key) is not True:
|
if EveApiManager.check_api_is_full(api_id, api_key) is not True:
|
||||||
logger.debug("Api id %s does not meet member access mask requirements - failed validation." % api_id)
|
logger.info("Api id %s does not meet member access mask requirements - failed validation." % api_id)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -299,9 +299,9 @@ class EveApiManager():
|
|||||||
def validate_blue_api(api_id, api_key):
|
def validate_blue_api(api_id, api_key):
|
||||||
if settings.BLUE_API_ACCOUNT:
|
if settings.BLUE_API_ACCOUNT:
|
||||||
if EveApiManager.check_api_is_type_account(api_id, api_key) is not True:
|
if EveApiManager.check_api_is_type_account(api_id, api_key) is not True:
|
||||||
logger.debug("Api id %s is not type account as required for blues - failed validation." % api_id)
|
logger.info("Api id %s is not type account as required for blues - failed validation." % api_id)
|
||||||
return False
|
return False
|
||||||
if EveApiManager.check_blue_api_is_full(api_id, api_key) is not True:
|
if EveApiManager.check_blue_api_is_full(api_id, api_key) is not True:
|
||||||
logger.debug("Api id %s does not meet minimum blue access mask requirements - failed validation." % api_id)
|
logger.info("Api id %s does not meet minimum blue access mask requirements - failed validation." % api_id)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
@ -47,7 +47,7 @@ class Phpbb3Manager:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def __add_avatar(username, characterid):
|
def __add_avatar(username, characterid):
|
||||||
logger.debug("Adding EVE character id %s portrait as phpbb avater for user %s" % (characterid, username))
|
logger.debug("Adding EVE character id %s portrait as phpbb avater for user %s" % (characterid, username))
|
||||||
avatar_url = "http://image.eveonline.com/Character/" + characterid + "_64.jpg"
|
avatar_url = "https://image.eveonline.com/Character/" + characterid + "_64.jpg"
|
||||||
cursor = connections['phpbb3'].cursor()
|
cursor = connections['phpbb3'].cursor()
|
||||||
userid = Phpbb3Manager.__get_user_id(username)
|
userid = Phpbb3Manager.__get_user_id(username)
|
||||||
cursor.execute(Phpbb3Manager.SQL_ADD_USER_AVATAR, [avatar_url, userid])
|
cursor.execute(Phpbb3Manager.SQL_ADD_USER_AVATAR, [avatar_url, userid])
|
||||||
|
@ -279,13 +279,11 @@ class Teamspeak3Manager:
|
|||||||
if user_ts_groups[user_ts_group_key] not in ts_groups.values():
|
if user_ts_groups[user_ts_group_key] not in ts_groups.values():
|
||||||
remgroups.append(user_ts_groups[user_ts_group_key])
|
remgroups.append(user_ts_groups[user_ts_group_key])
|
||||||
|
|
||||||
logger.info("Finished checking user id %s TS3 groups - adding %s, removing %s." % (userid, addgroups, remgroups))
|
|
||||||
|
|
||||||
for g in addgroups:
|
for g in addgroups:
|
||||||
logger.debug("Issuing add command for group %s" % g)
|
logger.info("Adding Teamspeak user %s into group %s" % (userid, g))
|
||||||
Teamspeak3Manager._add_user_to_group(userid, g)
|
Teamspeak3Manager._add_user_to_group(userid, g)
|
||||||
|
|
||||||
for g in remgroups:
|
for g in remgroups:
|
||||||
logger.debug("Issuing remove command for group %s" % g)
|
logger.info("Removing Teamspeak user %s from group %s" % (userid, g))
|
||||||
Teamspeak3Manager._remove_user_from_group(userid, g)
|
Teamspeak3Manager._remove_user_from_group(userid, g)
|
||||||
|
|
||||||
|
@ -5,8 +5,12 @@ from django.core.validators import MaxValueValidator, MinValueValidator
|
|||||||
|
|
||||||
class SignatureForm(forms.Form):
|
class SignatureForm(forms.Form):
|
||||||
sigtype = [('Wormhole', 'Wormhole'), ('Combat', 'Combat'), ('Data', 'Data'),
|
sigtype = [('Wormhole', 'Wormhole'), ('Combat', 'Combat'), ('Data', 'Data'),
|
||||||
('Relic', 'Relic')]
|
('Relic', 'Relic'), ('Gas', 'Gas'), ('Ore', 'Ore')]
|
||||||
status = [('Open', 'Open'), ('Started', 'Started'), ('Finished', 'Finished')]
|
status = [('Open', 'Open'), ('Started', 'Started'), ('Finished', 'Finished'), ('Life cycle has not begun', 'Life cycle has not begun'),
|
||||||
|
('Probably wont last another day', 'Probably wont last another day'), ('End of its natural lifetime', 'End of its natural lifetime'),
|
||||||
|
('stability not significantly disrupted', 'stability not significantly disrupted'),
|
||||||
|
('Stability reduced not critical degree yet', 'Stability reduced not critical degree yet'),
|
||||||
|
('Wormhole stability critically disrupted', 'Wormhole stability critically disrupted')]
|
||||||
|
|
||||||
system = forms.CharField(max_length=254, required=True, label='System')
|
system = forms.CharField(max_length=254, required=True, label='System')
|
||||||
ident = forms.CharField(max_length=254, required=True, label="ID")
|
ident = forms.CharField(max_length=254, required=True, label="ID")
|
||||||
|
@ -1,187 +1,187 @@
|
|||||||
{% extends "public/base.html" %}
|
{% extends "public/base.html" %}
|
||||||
{% load bootstrap %}
|
{% load bootstrap %}
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
|
|
||||||
{% block title %}Alliance Auth{% endblock %}
|
{% block title %}Alliance Auth{% endblock %}
|
||||||
{% block page_title %}Corporation Member Tracking{% endblock page_title %}
|
{% block page_title %}Corporation Member Tracking{% endblock page_title %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<h1 class="page-header text-center">Corporation Member Data</h1>
|
<h1 class="page-header text-center">Corporation Member Data</h1>
|
||||||
{% if perms.auth.corputils %}
|
{% if perms.auth.corputils %}
|
||||||
<div class="col-lg-12 container" id="example">
|
<div class="col-lg-12 container" id="example">
|
||||||
{% if corp %}
|
{% if corp %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">Corporation</div>
|
<div class="panel-heading">Corporation</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="col-lg-5 col-sm-2">
|
<div class="col-lg-5 col-sm-2">
|
||||||
<img class="ra-avatar img-responsive" src="https://image.eveonline.com/Corporation/{{ corp.corporation_id }}_128.png">
|
<img class="ra-avatar img-responsive" src="https://image.eveonline.com/Corporation/{{ corp.corporation_id }}_128.png">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-7 col-sm-2">
|
<div class="col-lg-7 col-sm-2">
|
||||||
<h4 class="">{{ corp.corporation_name }}</h4>
|
<h4 class="">{{ corp.corporation_name }}</h4>
|
||||||
|
|
||||||
<p>Ticker: {{ corp.corporation_ticker }}</p>
|
<p>Ticker: {{ corp.corporation_ticker }}</p>
|
||||||
|
|
||||||
<p>Member count: {{ corp.member_count }}</p>
|
<p>Member count: {{ corp.member_count }}</p>
|
||||||
|
|
||||||
<p>Player count: {{characters_with_api|length}}</p>
|
<p>Player count: {{characters_with_api|length}}</p>
|
||||||
|
|
||||||
<p>Unregistered characters: {{characters_without_api|length}}</p>
|
<p>Unregistered characters: {{characters_without_api|length}}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-12 col-sm-5">
|
<div class="col-lg-12 col-sm-5">
|
||||||
<b>API Index:</b>
|
<b>API Index:</b>
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
<div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="{{characters_with_api|length}}" aria-valuemin="0" aria-valuemax="{{ corp.member_count }}" style="width: {% widthratio characters_with_api|length corp.member_count 100 %}%;">
|
<div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="{{characters_with_api|length}}" aria-valuemin="0" aria-valuemax="{{ corp.member_count }}" style="width: {% widthratio characters_with_api|length corp.member_count 100 %}%;">
|
||||||
{{characters_with_api|length}}/{{ corp.member_count }}
|
{{characters_with_api|length}}/{{ corp.member_count }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<nav class="navbar navbar-default">
|
<nav class="navbar navbar-default">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<ul class="nav navbar-nav navbar-wide">
|
<ul class="nav navbar-nav navbar-wide">
|
||||||
{% if membercorp_list %}
|
{% if membercorp_list %}
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Choose corporation <span class="caret"></span></a>
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Choose corporation <span class="caret"></span></a>
|
||||||
<ul class="dropdown-menu scrollable">
|
<ul class="dropdown-menu scrollable">
|
||||||
{% for membercorp_id, membercorp_name in membercorp_list %}
|
{% for membercorp_id, membercorp_name in membercorp_list %}
|
||||||
<li>
|
<li>
|
||||||
<a href="/corputils/{{ membercorp_id }}">{{ membercorp_name }}</a>
|
<a href="/corputils/{{ membercorp_id }}">{{ membercorp_name }}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li style="float: right">
|
<li style="float: right">
|
||||||
<p class="navbar-btn">
|
<p class="navbar-btn">
|
||||||
<a href="https://zkillboard.com/corporation/{{ corp.corporation_id }}/" class="btn btn-default" target="_blank">{{ corp.corporation_name }} Killboard</a>
|
<a href="https://zkillboard.com/corporation/{{ corp.corporation_id }}/" class="btn btn-default" target="_blank">{{ corp.corporation_name }} Killboard</a>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li style="float: right">
|
<li style="float: right">
|
||||||
<form class="navbar-form navbar-left" role="search" action={% url 'auth_corputils_search' %}{{ corp.corporation_id }}/ method="POST">
|
<form class="navbar-form navbar-left" role="search" action={% url 'auth_corputils_search' %}{{ corp.corporation_id }}/ method="POST">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ search_form.as_table }}
|
{{ search_form.as_table }}
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-default" type="submit">Search</button>
|
<button class="btn btn-default" type="submit">Search</button>
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li class="active"><a data-toggle="tab" href="#gotapi">Registered Main Characters <b>({{characters_with_api|length}})</b></a></li>
|
<li class="active"><a data-toggle="tab" href="#gotapi">Registered Main Characters <b>({{characters_with_api|length}})</b></a></li>
|
||||||
<li><a data-toggle="tab" href="#noapi">Characters without API <b>({{characters_without_api|length}})</b></a></li>
|
<li><a data-toggle="tab" href="#noapi">Characters without API <b>({{characters_without_api|length}})</b></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div id="gotapi" class="tab-pane fade in active">
|
<div id="gotapi" class="tab-pane fade in active">
|
||||||
{% if characters_with_api %}
|
{% if characters_with_api %}
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-condensed table-hover table-striped">
|
<table class="table table-condensed table-hover table-striped">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="col-md-1"></th>
|
<th class="col-md-1"></th>
|
||||||
<th class="col-md-2">Main character</th>
|
<th class="col-md-2">Main character</th>
|
||||||
<th class="col-md-2">Main corporation</th>
|
<th class="col-md-2">Main corporation</th>
|
||||||
<th class="col-md-2">Character list</th>
|
<th class="col-md-2">Character list</th>
|
||||||
<th class="col-md-5">Killboard</th>
|
<th class="col-md-5">Killboard</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for maincharname, player in characters_with_api %}
|
{% for maincharname, player in characters_with_api %}
|
||||||
<tr >
|
<tr >
|
||||||
<td>
|
<td>
|
||||||
<img src="http://image.eveonline.com/Character/{{ player.main.character_id }}_32.jpg" class="img-circle">
|
<img src="http://image.eveonline.com/Character/{{ player.main.character_id }}_32.jpg" class="img-circle">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>{{ maincharname }}</p>
|
<p>{{ maincharname }}</p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if not corp.corporation_name == player.maincorp%}
|
{% if not corp.corporation_name == player.maincorp%}
|
||||||
<span class="label label-danger">
|
<span class="label label-danger">
|
||||||
{{ player.maincorp }}
|
{{ player.maincorp }}
|
||||||
</span>
|
</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="label label-success">
|
<span class="label label-success">
|
||||||
{{ player.maincorp }}
|
{{ player.maincorp }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% for char in player.altlist %}
|
{% for char in player.altlist %}
|
||||||
<p>{{ char.character_name }}</p>
|
<p>{{ char.character_name }}</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% for char in player.altlist %}
|
{% for char in player.altlist %}
|
||||||
<p><a href="https://zkillboard.com/character/{{ char.character_id }}/" class="label label-danger" target="_blank">Killboard</a></p>
|
<p><a href="https://zkillboard.com/character/{{ char.character_id }}/" class="label label-danger" target="_blank">Killboard</a></p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="alert alert-danger" role="alert">
|
<div class="alert alert-danger" role="alert">
|
||||||
<h3>Seems there are no characters in {{ corp.corporation_name }} tied to a registered API!</h3>
|
<h3>Seems there are no characters in {{ corp.corporation_name }} tied to a registered API!</h3>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div id="noapi" class="tab-pane fade">
|
<div id="noapi" class="tab-pane fade">
|
||||||
{% if characters_without_api %}
|
{% if characters_without_api %}
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-condensed table-hover table-striped">
|
<table class="table table-condensed table-hover table-striped">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="col-md-1"></th>
|
<th class="col-md-1"></th>
|
||||||
<th class="col-md-2">Character</th>
|
<th class="col-md-2">Character</th>
|
||||||
<th class="col-md-5">Killboard</th>
|
<th class="col-md-5">Killboard</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for character_name, character_id in characters_without_api %}
|
{% for character_name, character_id in characters_without_api %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<img src="http://image.eveonline.com/Character/{{ character_id }}_32.jpg" class="img-circle">
|
<img src="http://image.eveonline.com/Character/{{ character_id }}_32.jpg" class="img-circle">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<p>{{ character_name }}</p>
|
<p>{{ character_name }}</p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="https://zkillboard.com/character/{{ character_id }}/" class="label label-danger" target="_blank">Killboard</a>
|
<a href="https://zkillboard.com/character/{{ character_id }}/" class="label label-danger" target="_blank">Killboard</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="alert alert-success" role="alert">
|
<div class="alert alert-success" role="alert">
|
||||||
<h3>Good job! Every character in {{ corp.corporation_name }} seem to be tied to an API!</h3>
|
<h3>Good job! Every character in {{ corp.corporation_name }} seem to be tied to an API!</h3>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="col-md-4 col-md-offset-4">
|
<div class="col-md-4 col-md-offset-4">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="alert alert-danger text-center" role="alert">No corporation model found. Contact your admin.</div>
|
<div class="alert alert-danger text-center" role="alert">No corporation model found. Contact your admin.</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if IS_CORP %}
|
{% if IS_CORP %}
|
||||||
<div class="alert alert-danger" role="alert">You are not in the corporation.</div>
|
<div class="alert alert-danger" role="alert">You are not in the corporation.</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="alert alert-danger" role="alert">You are not in the alliance.</div>
|
<div class="alert alert-danger" role="alert">You are not in the alliance.</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user