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):
|
||||
logger.debug("logout_user called by user %s" % request.user)
|
||||
logoutUser = request.user
|
||||
logout(request)
|
||||
logger.info("Successful logout for user %s" % request.user)
|
||||
logger.info("Successful logout for user %s" % logoutUser)
|
||||
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))
|
||||
authserviceinfo.main_char_id = ''
|
||||
authserviceinfo.save()
|
||||
else:
|
||||
logger.warn("User %s has no main character id, unable to validate membership.")
|
||||
set_state(user)
|
||||
|
||||
|
||||
|
@ -287,11 +287,11 @@ class EveApiManager():
|
||||
def validate_member_api(api_id, api_key):
|
||||
if settings.MEMBER_API_ACCOUNT:
|
||||
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
|
||||
|
||||
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 True
|
||||
|
||||
@ -299,9 +299,9 @@ class EveApiManager():
|
||||
def validate_blue_api(api_id, api_key):
|
||||
if settings.BLUE_API_ACCOUNT:
|
||||
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
|
||||
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 True
|
||||
|
@ -47,7 +47,7 @@ class Phpbb3Manager:
|
||||
@staticmethod
|
||||
def __add_avatar(username, characterid):
|
||||
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()
|
||||
userid = Phpbb3Manager.__get_user_id(username)
|
||||
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():
|
||||
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:
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
|
@ -5,8 +5,12 @@ from django.core.validators import MaxValueValidator, MinValueValidator
|
||||
|
||||
class SignatureForm(forms.Form):
|
||||
sigtype = [('Wormhole', 'Wormhole'), ('Combat', 'Combat'), ('Data', 'Data'),
|
||||
('Relic', 'Relic')]
|
||||
status = [('Open', 'Open'), ('Started', 'Started'), ('Finished', 'Finished')]
|
||||
('Relic', 'Relic'), ('Gas', 'Gas'), ('Ore', 'Ore')]
|
||||
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')
|
||||
ident = forms.CharField(max_length=254, required=True, label="ID")
|
||||
|
@ -1,187 +1,187 @@
|
||||
{% extends "public/base.html" %}
|
||||
{% load bootstrap %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block title %}Alliance Auth{% endblock %}
|
||||
{% block page_title %}Corporation Member Tracking{% endblock page_title %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">Corporation Member Data</h1>
|
||||
{% if perms.auth.corputils %}
|
||||
<div class="col-lg-12 container" id="example">
|
||||
{% if corp %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Corporation</div>
|
||||
<div class="panel-body">
|
||||
<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">
|
||||
</div>
|
||||
<div class="col-lg-7 col-sm-2">
|
||||
<h4 class="">{{ corp.corporation_name }}</h4>
|
||||
|
||||
<p>Ticker: {{ corp.corporation_ticker }}</p>
|
||||
|
||||
<p>Member count: {{ corp.member_count }}</p>
|
||||
|
||||
<p>Player count: {{characters_with_api|length}}</p>
|
||||
|
||||
<p>Unregistered characters: {{characters_without_api|length}}</p>
|
||||
</div>
|
||||
<div class="col-lg-12 col-sm-5">
|
||||
<b>API Index:</b>
|
||||
<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 %}%;">
|
||||
{{characters_with_api|length}}/{{ corp.member_count }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="container-fluid">
|
||||
<ul class="nav navbar-nav navbar-wide">
|
||||
{% if membercorp_list %}
|
||||
<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>
|
||||
<ul class="dropdown-menu scrollable">
|
||||
{% for membercorp_id, membercorp_name in membercorp_list %}
|
||||
<li>
|
||||
<a href="/corputils/{{ membercorp_id }}">{{ membercorp_name }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li style="float: right">
|
||||
<p class="navbar-btn">
|
||||
<a href="https://zkillboard.com/corporation/{{ corp.corporation_id }}/" class="btn btn-default" target="_blank">{{ corp.corporation_name }} Killboard</a>
|
||||
</p>
|
||||
</li>
|
||||
<li style="float: right">
|
||||
<form class="navbar-form navbar-left" role="search" action={% url 'auth_corputils_search' %}{{ corp.corporation_id }}/ method="POST">
|
||||
<div class="form-group">
|
||||
{% csrf_token %}
|
||||
{{ search_form.as_table }}
|
||||
</div>
|
||||
<button class="btn btn-default" type="submit">Search</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<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><a data-toggle="tab" href="#noapi">Characters without API <b>({{characters_without_api|length}})</b></a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="gotapi" class="tab-pane fade in active">
|
||||
{% if characters_with_api %}
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-condensed table-hover table-striped">
|
||||
<tr>
|
||||
<th class="col-md-1"></th>
|
||||
<th class="col-md-2">Main character</th>
|
||||
<th class="col-md-2">Main corporation</th>
|
||||
<th class="col-md-2">Character list</th>
|
||||
<th class="col-md-5">Killboard</th>
|
||||
</tr>
|
||||
{% for maincharname, player in characters_with_api %}
|
||||
<tr >
|
||||
<td>
|
||||
<img src="http://image.eveonline.com/Character/{{ player.main.character_id }}_32.jpg" class="img-circle">
|
||||
</td>
|
||||
<td>
|
||||
<p>{{ maincharname }}</p>
|
||||
</td>
|
||||
<td>
|
||||
{% if not corp.corporation_name == player.maincorp%}
|
||||
<span class="label label-danger">
|
||||
{{ player.maincorp }}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="label label-success">
|
||||
{{ player.maincorp }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% for char in player.altlist %}
|
||||
<p>{{ char.character_name }}</p>
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td>
|
||||
{% for char in player.altlist %}
|
||||
<p><a href="https://zkillboard.com/character/{{ char.character_id }}/" class="label label-danger" target="_blank">Killboard</a></p>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<h3>Seems there are no characters in {{ corp.corporation_name }} tied to a registered API!</h3>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div id="noapi" class="tab-pane fade">
|
||||
{% if characters_without_api %}
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-condensed table-hover table-striped">
|
||||
<tr>
|
||||
<th class="col-md-1"></th>
|
||||
<th class="col-md-2">Character</th>
|
||||
<th class="col-md-5">Killboard</th>
|
||||
</tr>
|
||||
{% for character_name, character_id in characters_without_api %}
|
||||
<tr>
|
||||
<td>
|
||||
<img src="http://image.eveonline.com/Character/{{ character_id }}_32.jpg" class="img-circle">
|
||||
</td>
|
||||
<td>
|
||||
<p>{{ character_name }}</p>
|
||||
</td>
|
||||
<td>
|
||||
<a href="https://zkillboard.com/character/{{ character_id }}/" class="label label-danger" target="_blank">Killboard</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-success" role="alert">
|
||||
<h3>Good job! Every character in {{ corp.corporation_name }} seem to be tied to an API!</h3>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="container-fluid">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="row">
|
||||
<div class="alert alert-danger text-center" role="alert">No corporation model found. Contact your admin.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% 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 %}
|
||||
{% extends "public/base.html" %}
|
||||
{% load bootstrap %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block title %}Alliance Auth{% endblock %}
|
||||
{% block page_title %}Corporation Member Tracking{% endblock page_title %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">Corporation Member Data</h1>
|
||||
{% if perms.auth.corputils %}
|
||||
<div class="col-lg-12 container" id="example">
|
||||
{% if corp %}
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Corporation</div>
|
||||
<div class="panel-body">
|
||||
<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">
|
||||
</div>
|
||||
<div class="col-lg-7 col-sm-2">
|
||||
<h4 class="">{{ corp.corporation_name }}</h4>
|
||||
|
||||
<p>Ticker: {{ corp.corporation_ticker }}</p>
|
||||
|
||||
<p>Member count: {{ corp.member_count }}</p>
|
||||
|
||||
<p>Player count: {{characters_with_api|length}}</p>
|
||||
|
||||
<p>Unregistered characters: {{characters_without_api|length}}</p>
|
||||
</div>
|
||||
<div class="col-lg-12 col-sm-5">
|
||||
<b>API Index:</b>
|
||||
<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 %}%;">
|
||||
{{characters_with_api|length}}/{{ corp.member_count }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="container-fluid">
|
||||
<ul class="nav navbar-nav navbar-wide">
|
||||
{% if membercorp_list %}
|
||||
<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>
|
||||
<ul class="dropdown-menu scrollable">
|
||||
{% for membercorp_id, membercorp_name in membercorp_list %}
|
||||
<li>
|
||||
<a href="/corputils/{{ membercorp_id }}">{{ membercorp_name }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li style="float: right">
|
||||
<p class="navbar-btn">
|
||||
<a href="https://zkillboard.com/corporation/{{ corp.corporation_id }}/" class="btn btn-default" target="_blank">{{ corp.corporation_name }} Killboard</a>
|
||||
</p>
|
||||
</li>
|
||||
<li style="float: right">
|
||||
<form class="navbar-form navbar-left" role="search" action={% url 'auth_corputils_search' %}{{ corp.corporation_id }}/ method="POST">
|
||||
<div class="form-group">
|
||||
{% csrf_token %}
|
||||
{{ search_form.as_table }}
|
||||
</div>
|
||||
<button class="btn btn-default" type="submit">Search</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<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><a data-toggle="tab" href="#noapi">Characters without API <b>({{characters_without_api|length}})</b></a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="gotapi" class="tab-pane fade in active">
|
||||
{% if characters_with_api %}
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-condensed table-hover table-striped">
|
||||
<tr>
|
||||
<th class="col-md-1"></th>
|
||||
<th class="col-md-2">Main character</th>
|
||||
<th class="col-md-2">Main corporation</th>
|
||||
<th class="col-md-2">Character list</th>
|
||||
<th class="col-md-5">Killboard</th>
|
||||
</tr>
|
||||
{% for maincharname, player in characters_with_api %}
|
||||
<tr >
|
||||
<td>
|
||||
<img src="http://image.eveonline.com/Character/{{ player.main.character_id }}_32.jpg" class="img-circle">
|
||||
</td>
|
||||
<td>
|
||||
<p>{{ maincharname }}</p>
|
||||
</td>
|
||||
<td>
|
||||
{% if not corp.corporation_name == player.maincorp%}
|
||||
<span class="label label-danger">
|
||||
{{ player.maincorp }}
|
||||
</span>
|
||||
{% else %}
|
||||
<span class="label label-success">
|
||||
{{ player.maincorp }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% for char in player.altlist %}
|
||||
<p>{{ char.character_name }}</p>
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td>
|
||||
{% for char in player.altlist %}
|
||||
<p><a href="https://zkillboard.com/character/{{ char.character_id }}/" class="label label-danger" target="_blank">Killboard</a></p>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<h3>Seems there are no characters in {{ corp.corporation_name }} tied to a registered API!</h3>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div id="noapi" class="tab-pane fade">
|
||||
{% if characters_without_api %}
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-condensed table-hover table-striped">
|
||||
<tr>
|
||||
<th class="col-md-1"></th>
|
||||
<th class="col-md-2">Character</th>
|
||||
<th class="col-md-5">Killboard</th>
|
||||
</tr>
|
||||
{% for character_name, character_id in characters_without_api %}
|
||||
<tr>
|
||||
<td>
|
||||
<img src="http://image.eveonline.com/Character/{{ character_id }}_32.jpg" class="img-circle">
|
||||
</td>
|
||||
<td>
|
||||
<p>{{ character_name }}</p>
|
||||
</td>
|
||||
<td>
|
||||
<a href="https://zkillboard.com/character/{{ character_id }}/" class="label label-danger" target="_blank">Killboard</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-success" role="alert">
|
||||
<h3>Good job! Every character in {{ corp.corporation_name }} seem to be tied to an API!</h3>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="container-fluid">
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<div class="row">
|
||||
<div class="alert alert-danger text-center" role="alert">No corporation model found. Contact your admin.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% 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 %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user