mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-04 14:16:21 +01:00
Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
debd6ef2b9 | ||
|
|
58e9c21e4f | ||
|
|
c7c3083e3e | ||
|
|
63d061e9f2 | ||
|
|
1887bdb90a | ||
|
|
69addb068a | ||
|
|
a62c3ce0f9 | ||
|
|
aecc94bdb3 | ||
|
|
fcb7f2905a | ||
|
|
34c7169ca3 | ||
|
|
6e450061f4 | ||
|
|
fc3d7e9f43 | ||
|
|
514db4f9a2 | ||
|
|
23a8b65ce2 | ||
|
|
f8e6662bc8 | ||
|
|
89be2456fb | ||
|
|
bfd3451717 | ||
|
|
0b759d6a32 | ||
|
|
65e05084e6 | ||
|
|
f25a4ed386 | ||
|
|
b2a1d41829 | ||
|
|
2741a92d31 | ||
|
|
3570ce86d7 | ||
|
|
d809902d1e | ||
|
|
ec4232c00a | ||
|
|
dec793bfac | ||
|
|
fe3fe0527a | ||
|
|
a8855e86ed | ||
|
|
179d1c38e6 | ||
|
|
287da73a4f | ||
|
|
e9ed917888 | ||
|
|
70d842c971 | ||
|
|
bcda228e05 | ||
|
|
000dafc5e6 | ||
|
|
4ea824fe71 | ||
|
|
f72f539516 | ||
|
|
1b192a184f | ||
|
|
0edf896b4c |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -62,5 +62,7 @@ celerybeat-schedule
|
|||||||
|
|
||||||
#pycharm
|
#pycharm
|
||||||
.idea/*
|
.idea/*
|
||||||
|
|
||||||
/nbproject/
|
/nbproject/
|
||||||
|
|
||||||
|
#gitlab configs
|
||||||
|
.gitlab/
|
||||||
|
|||||||
@@ -25,14 +25,6 @@
|
|||||||
|
|
||||||
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
|
coverage: '/TOTAL.+ ([0-9]{1,3}%)/'
|
||||||
|
|
||||||
|
|
||||||
py36-dj111:
|
|
||||||
<<: *job_definition
|
|
||||||
image: python:3.6-stretch
|
|
||||||
script:
|
|
||||||
- export TOXENV=py36-dj111
|
|
||||||
- tox
|
|
||||||
|
|
||||||
py36-dj20:
|
py36-dj20:
|
||||||
<<: *job_definition
|
<<: *job_definition
|
||||||
image: python:3.6-stretch
|
image: python:3.6-stretch
|
||||||
|
|||||||
14
.gitlab/issue_templates/Bug.md
Normal file
14
.gitlab/issue_templates/Bug.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Bug
|
||||||
|
|
||||||
|
- I have searched [issues](https://gitlab.com/allianceauth/allianceauth/issues?scope=all&utf8=%E2%9C%93&state=all) (Y/N):
|
||||||
|
- What Version of Alliance Auth:
|
||||||
|
- What Operating System:
|
||||||
|
- Version of other components relevant to issue eg. Service, Database:
|
||||||
|
|
||||||
|
Please include a brief description of your issue here.
|
||||||
|
|
||||||
|
Please include steps to reproduce the issue
|
||||||
|
|
||||||
|
Please include any tracebacks or logs
|
||||||
|
|
||||||
|
Please include the results of the command `pip list`
|
||||||
7
.gitlab/issue_templates/Feature Request.md
Normal file
7
.gitlab/issue_templates/Feature Request.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Feature Request
|
||||||
|
|
||||||
|
- Describe the feature are you requesting.
|
||||||
|
|
||||||
|
- Is this a Service (external integration), a Module (Alliance Auth extension) or an enhancement to an existing service/module.
|
||||||
|
|
||||||
|
- Describe why its useful to you or others.
|
||||||
@@ -19,6 +19,8 @@ Active Developers:
|
|||||||
|
|
||||||
- [Adarnof](https://gitlab.com/adarnof/)
|
- [Adarnof](https://gitlab.com/adarnof/)
|
||||||
- [Basraah](https://gitlab.com/basraah/)
|
- [Basraah](https://gitlab.com/basraah/)
|
||||||
|
- [Ariel Rin](https://gitlab.com/soratidus999/)
|
||||||
|
- [Col Crunch](https://gitlab.com/colcrunch/)
|
||||||
|
|
||||||
Beta Testers / Bug Fixers:
|
Beta Testers / Bug Fixers:
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# This will make sure the app is always imported when
|
# This will make sure the app is always imported when
|
||||||
# Django starts so that shared_task will use this app.
|
# Django starts so that shared_task will use this app.
|
||||||
|
|
||||||
__version__ = '2.1.1'
|
__version__ = '2.2.2'
|
||||||
NAME = 'Alliance Auth v%s' % __version__
|
NAME = 'Alliance Auth v%s' % __version__
|
||||||
default_app_config = 'allianceauth.apps.AllianceAuthConfig'
|
default_app_config = 'allianceauth.apps.AllianceAuthConfig'
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class StateBackend(ModelBackend):
|
|||||||
user_obj._perm_cache.update(self.get_state_permissions(user_obj))
|
user_obj._perm_cache.update(self.get_state_permissions(user_obj))
|
||||||
return user_obj._perm_cache
|
return user_obj._perm_cache
|
||||||
|
|
||||||
def authenticate(self, token=None):
|
def authenticate(self, request=None, token=None, **credentials):
|
||||||
if not token:
|
if not token:
|
||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ class BackendTestCase(TestCase):
|
|||||||
def test_authenticate_character_record(self):
|
def test_authenticate_character_record(self):
|
||||||
t = Token(character_id=self.unclaimed_character.character_id, character_name=self.unclaimed_character.character_name, character_owner_hash='4')
|
t = Token(character_id=self.unclaimed_character.character_id, character_name=self.unclaimed_character.character_name, character_owner_hash='4')
|
||||||
record = OwnershipRecord.objects.create(user=self.old_user, character=self.unclaimed_character, owner_hash='4')
|
record = OwnershipRecord.objects.create(user=self.old_user, character=self.unclaimed_character, owner_hash='4')
|
||||||
user = StateBackend().authenticate(t)
|
user = StateBackend().authenticate(token=t)
|
||||||
self.assertEqual(user, self.old_user)
|
self.assertEqual(user, self.old_user)
|
||||||
self.assertTrue(CharacterOwnership.objects.filter(owner_hash='4', user=self.old_user).exists())
|
self.assertTrue(CharacterOwnership.objects.filter(owner_hash='4', user=self.old_user).exists())
|
||||||
self.assertTrue(user.profile.main_character)
|
self.assertTrue(user.profile.main_character)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from .models import AutogroupsConfig
|
from .models import AutogroupsConfig, ManagedCorpGroup, ManagedAllianceGroup
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@@ -37,3 +37,6 @@ class AutogroupsConfigAdmin(admin.ModelAdmin):
|
|||||||
|
|
||||||
|
|
||||||
admin.site.register(AutogroupsConfig, AutogroupsConfigAdmin)
|
admin.site.register(AutogroupsConfig, AutogroupsConfigAdmin)
|
||||||
|
admin.site.register(ManagedCorpGroup)
|
||||||
|
admin.site.register(ManagedAllianceGroup)
|
||||||
|
|
||||||
|
|||||||
@@ -179,15 +179,13 @@ class AutogroupsConfig(models.Model):
|
|||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def create_alliance_group(self, alliance: EveAllianceInfo) -> Group:
|
def create_alliance_group(self, alliance: EveAllianceInfo) -> Group:
|
||||||
group, created = Group.objects.get_or_create(name=self.get_alliance_group_name(alliance))
|
group, created = Group.objects.get_or_create(name=self.get_alliance_group_name(alliance))
|
||||||
if created:
|
ManagedAllianceGroup.objects.get_or_create(group=group, config=self, alliance=alliance)
|
||||||
ManagedAllianceGroup.objects.create(group=group, config=self, alliance=alliance)
|
|
||||||
return group
|
return group
|
||||||
|
|
||||||
@transaction.atomic
|
@transaction.atomic
|
||||||
def create_corp_group(self, corp: EveCorporationInfo) -> Group:
|
def create_corp_group(self, corp: EveCorporationInfo) -> Group:
|
||||||
group, created = Group.objects.get_or_create(name=self.get_corp_group_name(corp))
|
group, created = Group.objects.get_or_create(name=self.get_corp_group_name(corp))
|
||||||
if created:
|
ManagedCorpGroup.objects.get_or_create(group=group, config=self, corp=corp)
|
||||||
ManagedCorpGroup.objects.create(group=group, config=self, corp=corp)
|
|
||||||
return group
|
return group
|
||||||
|
|
||||||
def delete_alliance_managed_groups(self):
|
def delete_alliance_managed_groups(self):
|
||||||
@@ -240,6 +238,8 @@ class ManagedGroup(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return "Managed Group: %s" % self.group.name
|
||||||
|
|
||||||
class ManagedCorpGroup(ManagedGroup):
|
class ManagedCorpGroup(ManagedGroup):
|
||||||
corp = models.ForeignKey(EveCorporationInfo, on_delete=models.CASCADE)
|
corp = models.ForeignKey(EveCorporationInfo, on_delete=models.CASCADE)
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 2.0.8 on 2018-12-07 08:56
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('groupmanagement', '0010_authgroup_states'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='requestlog',
|
||||||
|
name='date',
|
||||||
|
field=models.DateTimeField(default=datetime.datetime(2018, 12, 7, 8, 56, 33, 846342)),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -4,6 +4,7 @@ from django.db import models
|
|||||||
from django.db.models.signals import post_save
|
from django.db.models.signals import post_save
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
from allianceauth.authentication.models import State
|
from allianceauth.authentication.models import State
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
|
||||||
class GroupRequest(models.Model):
|
class GroupRequest(models.Model):
|
||||||
@@ -30,6 +31,7 @@ class RequestLog(models.Model):
|
|||||||
request_info = models.CharField(max_length=254)
|
request_info = models.CharField(max_length=254)
|
||||||
action = models.BooleanField(default=0)
|
action = models.BooleanField(default=0)
|
||||||
request_actor = models.ForeignKey(User, on_delete=models.CASCADE)
|
request_actor = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||||
|
date = models.DateTimeField(auto_now_add=datetime.utcnow())
|
||||||
|
|
||||||
def requestor(self):
|
def requestor(self):
|
||||||
return self.request_info.split(":")[0]
|
return self.request_info.split(":")[0]
|
||||||
|
|||||||
@@ -3,38 +3,60 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block page_title %}{{ group }} {% trans "Audit Log" %}{% endblock page_title %}
|
{% block page_title %}{{ group }} {% trans "Audit Log" %}{% endblock page_title %}
|
||||||
{% block extra_css %}{% endblock extra_css %}
|
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<br>
|
<br>
|
||||||
{% include 'groupmanagement/menu.html' %}
|
{% include 'groupmanagement/menu.html' %}
|
||||||
<div>
|
<div>
|
||||||
{% if entries %}
|
|
||||||
<h3>{{ group }} Audit Log</h3>
|
<h3>{{ group }} Audit Log</h3>
|
||||||
<table class="table">
|
<p> All times displayed are EVE/UTC.</p>
|
||||||
<tr>
|
{% if entries %}
|
||||||
<th class="text-center">{% trans "Requestor" %}</th>
|
<div class="table-responsive">
|
||||||
<th class="text-center">{% trans "Main Character" %}</th>
|
<table class="table table-striped" id="log-entries">
|
||||||
<th class="text-center">{% trans "Group" %}</th>
|
<thead>
|
||||||
<th class="text-center">{% trans "Type" %}</th>
|
<th class="text-center" scope="col">{% trans "Date/Time" %}</th>
|
||||||
<th class="text-center">{% trans "Action" %}</th>
|
<th class="text-center" scope="col">{% trans "Requestor" %}</th>
|
||||||
<th class="text-center">{% trans "Actor" %}</th>
|
<th class="text-center" scope="col">{% trans "Main Character" %}</th>
|
||||||
</tr>
|
<th class="text-center" scope="col">{% trans "Group" %}</th>
|
||||||
{% for entry in entries %}
|
<th class="text-center" scope="col">{% trans "Type" %}</th>
|
||||||
<tr>
|
<th class="text-center" scope="col">{% trans "Action" %}</th>
|
||||||
<td class="text-center">{{ entry.requestor }}</td>
|
<th class="text-center" scope="col">{% trans "Actor" %}</th>
|
||||||
<td class="text-center">{{ entry.req_char }}</td>
|
</thead>
|
||||||
<td class="text-center">{{ entry.group }}</td>
|
<tbody>
|
||||||
<td class="text-center">{{ entry.type_to_str }}</td>
|
{% for entry in entries %}
|
||||||
<td class="text-center">{{ entry.action_to_str }}</td>
|
<tr>
|
||||||
<td class="text-center">{{ entry.request_actor }}</td>
|
<td class="text-center">{{ entry.date }}</td>
|
||||||
</tr>
|
<td class="text-center">{{ entry.requestor }}</td>
|
||||||
{% endfor %}
|
<td class="text-center">{{ entry.req_char }}</td>
|
||||||
</table>
|
<td class="text-center">{{ entry.group }}</td>
|
||||||
|
<td class="text-center">{{ entry.type_to_str }}</td>
|
||||||
|
{% if entry.request_type is None %}
|
||||||
|
<td class="text-center"> Removed</td>
|
||||||
|
{% else %}
|
||||||
|
<td class="text-center">{{ entry.action_to_str }}</td>
|
||||||
|
{% endif %}
|
||||||
|
<td class="text-center">{{ entry.request_actor }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="alert alert-warning text-center">{% trans "No entries found." %}</div>
|
<div class="alert alert-warning text-center">{% trans "No entries found for this group." %}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock %}
|
||||||
|
{% block extra_javascript %}
|
||||||
|
{% include 'bundles/datatables-js.html' %}
|
||||||
|
{% endblock %}
|
||||||
|
{% block extra_css %}
|
||||||
|
{% include 'bundles/datatables-css.html' %}
|
||||||
|
{% endblock %}
|
||||||
|
{% block extra_script %}
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('#log-entries').DataTable();
|
||||||
|
});
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ url
|
|||||||
{% for g in groups %}
|
{% for g in groups %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-center">{{ g.group.name }}</td>
|
<td class="text-center">{{ g.group.name }}</td>
|
||||||
<td class="text-center">{{ g.group.authgroup.description }}</td>
|
<td class="text-center">{{ g.group.authgroup.description|urlize }}</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{% if g.group in user.groups.all %}
|
{% if g.group in user.groups.all %}
|
||||||
{% if not g.request %}
|
{% if not g.request %}
|
||||||
@@ -32,9 +32,15 @@ url
|
|||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% elif not g.request %}
|
{% elif not g.request %}
|
||||||
<a href="{% url 'groupmanagement:request_add' g.group.id %}" class="btn btn-success">
|
{% if g.group.authgroup.open %}
|
||||||
{% trans "Request" %}
|
<a href="{% url 'groupmanagement:request_add' g.group.id %}" class="btn btn-success">
|
||||||
</a>
|
{% trans "Join" %}
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{% url 'groupmanagement:request_add' g.group.id %}" class="btn btn-primary">
|
||||||
|
{% trans "Request" %}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<button type="button" class="btn btn-primary" disabled>
|
<button type="button" class="btn btn-primary" disabled>
|
||||||
{{ g.request.status }}
|
{{ g.request.status }}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ urlpatterns = [
|
|||||||
name='membership'),
|
name='membership'),
|
||||||
url(r'^membership/(\w+)/$', views.group_membership_list,
|
url(r'^membership/(\w+)/$', views.group_membership_list,
|
||||||
name='membership_list'),
|
name='membership_list'),
|
||||||
url(r'^membership/(\w+)/audit/', views.group_membership_audit, name="audit_log"),
|
url(r'^membership/(\w+)/audit/$', views.group_membership_audit, name="audit_log"),
|
||||||
url(r'^membership/(\w+)/remove/(\w+)/$', views.group_membership_remove,
|
url(r'^membership/(\w+)/remove/(\w+)/$', views.group_membership_remove,
|
||||||
name='membership_remove'),
|
name='membership_remove'),
|
||||||
url(r'^request_add/(\w+)', views.group_request_add,
|
url(r'^request_add/(\w+)', views.group_request_add,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ from django.contrib.auth.decorators import login_required
|
|||||||
from django.contrib.auth.decorators import user_passes_test
|
from django.contrib.auth.decorators import user_passes_test
|
||||||
from django.contrib.auth.models import Group
|
from django.contrib.auth.models import Group
|
||||||
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
|
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
|
||||||
|
from django.core.paginator import Paginator, EmptyPage
|
||||||
from django.db.models import Count
|
from django.db.models import Count
|
||||||
from django.http import Http404
|
from django.http import Http404
|
||||||
from django.shortcuts import render, redirect, get_object_or_404
|
from django.shortcuts import render, redirect, get_object_or_404
|
||||||
@@ -83,10 +84,9 @@ def group_membership_audit(request, group_id):
|
|||||||
|
|
||||||
except ObjectDoesNotExist:
|
except ObjectDoesNotExist:
|
||||||
raise Http404("Group does not exist")
|
raise Http404("Group does not exist")
|
||||||
|
render_items = {'group': group.name}
|
||||||
entries = RequestLog.objects.filter(group=group)
|
entries = RequestLog.objects.filter(group=group).order_by('-date')
|
||||||
|
render_items['entries'] = entries
|
||||||
render_items = {'entries': entries, 'group': group.name}
|
|
||||||
|
|
||||||
return render(request, 'groupmanagement/audit.html', context=render_items)
|
return render(request, 'groupmanagement/audit.html', context=render_items)
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ DATABASES['default'] = {
|
|||||||
'PASSWORD': '',
|
'PASSWORD': '',
|
||||||
'HOST': '127.0.0.1',
|
'HOST': '127.0.0.1',
|
||||||
'PORT': '3306',
|
'PORT': '3306',
|
||||||
|
'OPTIONS': {'charset': 'utf8mb4'},
|
||||||
}
|
}
|
||||||
|
|
||||||
# Register an application at https://developers.eveonline.com for Authentication
|
# Register an application at https://developers.eveonline.com for Authentication
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ class DiscourseManager:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def __add_user_to_group(g_id, username):
|
def __add_user_to_group(g_id, username):
|
||||||
endpoint = ENDPOINTS['groups']['add_user']
|
endpoint = ENDPOINTS['groups']['add_user']
|
||||||
DiscourseManager.__exc(endpoint, g_id, usernames=[username])
|
DiscourseManager.__exc(endpoint, g_id, usernames=username)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __remove_user_from_group(g_id, username):
|
def __remove_user_from_group(g_id, username):
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
|
import urllib
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
@@ -61,7 +62,7 @@ class MumbleService(ServicesHook):
|
|||||||
'service_name': self.title,
|
'service_name': self.title,
|
||||||
'urls': urls,
|
'urls': urls,
|
||||||
'service_url': self.service_url,
|
'service_url': self.service_url,
|
||||||
'connect_url': request.user.mumble.username + '@' + self.service_url if MumbleTasks.has_account(request.user) else self.service_url,
|
'connect_url': urllib.parse.quote(request.user.mumble.username, safe="") + '@' + self.service_url if MumbleTasks.has_account(request.user) else self.service_url,
|
||||||
'username': request.user.mumble.username if MumbleTasks.has_account(request.user) else '',
|
'username': request.user.mumble.username if MumbleTasks.has_account(request.user) else '',
|
||||||
}, request=request)
|
}, request=request)
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ class Teamspeak3Manager:
|
|||||||
'tokendescription': username_clean,
|
'tokendescription': username_clean,
|
||||||
'tokencustomset': "ident=sso_uid value=%s" % username_clean})
|
'tokencustomset': "ident=sso_uid value=%s" % username_clean})
|
||||||
except TeamspeakError as e:
|
except TeamspeakError as e:
|
||||||
logger.error("Failed to add teamspeak user %s: %s" % (username, str(e)))
|
logger.error("Failed to add teamspeak user %s: %s" % (username_clean, str(e)))
|
||||||
return "",""
|
return "",""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ from .models import Teamspeak3User, AuthTS, TSgroup, StateGroup
|
|||||||
from .tasks import Teamspeak3Tasks
|
from .tasks import Teamspeak3Tasks
|
||||||
from .signals import m2m_changed_authts_group, post_save_authts, post_delete_authts
|
from .signals import m2m_changed_authts_group, post_save_authts, post_delete_authts
|
||||||
|
|
||||||
|
from .manager import Teamspeak3Manager
|
||||||
|
from .util.ts3 import TeamspeakError
|
||||||
|
from allianceauth.authentication.models import State
|
||||||
|
|
||||||
MODULE_PATH = 'allianceauth.services.modules.teamspeak3'
|
MODULE_PATH = 'allianceauth.services.modules.teamspeak3'
|
||||||
DEFAULT_AUTH_GROUP = 'Member'
|
DEFAULT_AUTH_GROUP = 'Member'
|
||||||
|
|
||||||
@@ -290,3 +294,31 @@ class Teamspeak3SignalsTestCase(TestCase):
|
|||||||
self.member.profile.save()
|
self.member.profile.save()
|
||||||
|
|
||||||
self.assertTrue(update_groups.called)
|
self.assertTrue(update_groups.called)
|
||||||
|
|
||||||
|
|
||||||
|
class Teamspeak3ManagerTestCase(TestCase):
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def my_side_effect(*args, **kwargs):
|
||||||
|
raise TeamspeakError(1)
|
||||||
|
|
||||||
|
@mock.patch.object(Teamspeak3Manager, '_group_list')
|
||||||
|
@mock.patch.object(Teamspeak3Manager, '_group_id_by_name')
|
||||||
|
def test_add_user_exception(self, _group_id_by_name, _group_list):
|
||||||
|
"""test 1st exception occuring in add_user()"""
|
||||||
|
# set mocks in Teamspeak3Manager class
|
||||||
|
_group_list.return_value = ['Member', 'Guest']
|
||||||
|
_group_id_by_name.return_value = 99
|
||||||
|
manager = Teamspeak3Manager()
|
||||||
|
server = mock.MagicMock()
|
||||||
|
server._connected.return_value = True
|
||||||
|
server.send_command = mock.Mock(side_effect=Teamspeak3ManagerTestCase.my_side_effect)
|
||||||
|
manager._server = server
|
||||||
|
|
||||||
|
# create test data
|
||||||
|
user = User.objects.create_user("dummy")
|
||||||
|
user.profile.state = State.objects.filter(name="Member").first()
|
||||||
|
|
||||||
|
# perform test
|
||||||
|
manager.add_user(user, "Dummy User")
|
||||||
|
|
||||||
@@ -4,8 +4,8 @@ from celery import shared_task
|
|||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from .hooks import ServicesHook
|
from .hooks import ServicesHook
|
||||||
from celery_once import QueueOnce as BaseTask, AlreadyQueued
|
from celery_once import QueueOnce as BaseTask, AlreadyQueued
|
||||||
from celery_once.helpers import now_unix
|
|
||||||
from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
|
from time import time
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -22,7 +22,7 @@ class DjangoBackend:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def raise_or_lock(key, timeout):
|
def raise_or_lock(key, timeout):
|
||||||
now = now_unix()
|
now = int(time())
|
||||||
result = cache.get(key)
|
result = cache.get(key)
|
||||||
if result:
|
if result:
|
||||||
remaining = int(result) - now
|
remaining = int(result) - now
|
||||||
|
|||||||
@@ -27,12 +27,14 @@
|
|||||||
|
|
||||||
{% menu_items %}
|
{% menu_items %}
|
||||||
|
|
||||||
<li>
|
{% if user.is_superuser %}
|
||||||
<a class="{% navactive request 'authentication:help' %}"
|
<li>
|
||||||
href="{% url 'authentication:help' %}">
|
<a class="{% navactive request 'authentication:help' %}"
|
||||||
<i class="fa fa-question fa-fw"></i> {% trans "Help" %}
|
href="{% url 'authentication:help' %}">
|
||||||
</a>
|
<i class="fa fa-question fa-fw"></i> {% trans "Help" %}
|
||||||
</li>
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -38,17 +38,17 @@ class TimerForm(forms.ModelForm):
|
|||||||
('POS[S]', 'POS[S]'),
|
('POS[S]', 'POS[S]'),
|
||||||
('POS[M]', 'POS[M]'),
|
('POS[M]', 'POS[M]'),
|
||||||
('POS[L]', 'POS[L]'),
|
('POS[L]', 'POS[L]'),
|
||||||
('Citadel[M]', 'Citadel[M]'),
|
('Astrahus', 'Astrahus'),
|
||||||
('Citadel[L]', 'Citadel[L]'),
|
('Fortizar', 'Fortizar'),
|
||||||
('Citadel[XL]', 'Citadel[XL]'),
|
('Keepstar', 'Keepstar'),
|
||||||
('Engineering Complex[M]', 'Engineering Complex[M]'),
|
('Raitaru', 'Raitaru'),
|
||||||
('Engineering Complex[L]', 'Engineering Complex[L]'),
|
('Azbel', 'Azbel'),
|
||||||
('Engineering Complex[XL]', 'Engineering Complex[XL]'),
|
('Sotiyo', 'Sotiyo'),
|
||||||
('Refinery[M]', 'Refinery[M]'),
|
('Athanor', 'Athanor'),
|
||||||
('Refinery[L]', 'Refinery[L]'),
|
('Tatara', 'Tatara'),
|
||||||
('Cyno Beacon','Cyno Beacon'),
|
('Pharolux Cyno Beacon', 'Pharolux Cyno Beacon'),
|
||||||
('Cyno Jammer','Cyno Jammer'),
|
('Tenebrex Cyno Jammer', 'Tenebrex Cyno Jammer'),
|
||||||
('Jump Gate','Jump Gate'),
|
('Ansiblex Jump Gate', 'Ansiblex Jump Gate'),
|
||||||
('Moon Mining Cycle', 'Moon Mining Cycle'),
|
('Moon Mining Cycle', 'Moon Mining Cycle'),
|
||||||
(_('Other'), _('Other'))]
|
(_('Other'), _('Other'))]
|
||||||
objective_choices = [('Friendly', _('Friendly')),
|
objective_choices = [('Friendly', _('Friendly')),
|
||||||
|
|||||||
@@ -37,128 +37,128 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% for timer in corp_timers %}
|
{% for timer in corp_timers %}
|
||||||
{% ifequal timer.important True %}
|
{% if timer.important == True %}
|
||||||
<tr class="danger">
|
<tr class="danger">
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr class="info">
|
<tr class="info">
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
<td style="width:150px" class="text-center">{{ timer.details }}</td>
|
<td style="width:150px" class="text-center">{{ timer.details }}</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{% ifequal timer.objective "Hostile" %}
|
{% if timer.objective == "Hostile" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
{% trans "Hostile" %}
|
{% trans "Hostile" %}
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.objective "Friendly" %}
|
{% if timer.objective == "Friendly" %}
|
||||||
<div class="label label-primary">
|
<div class="label label-primary">
|
||||||
{% trans "Friendly" %}
|
{% trans "Friendly" %}
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.objective "Neutral" %}
|
{% if timer.objective == "Neutral" %}
|
||||||
<div class="label label-default">
|
<div class="label label-default">
|
||||||
{% trans "Neutral" %}
|
{% trans "Neutral" %}
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center"><a
|
<td class="text-center"><a
|
||||||
href="http://evemaps.dotlan.net/system/{{ timer.system }}">{{ timer.system }} {{ timer.planet_moon }} </a>
|
href="http://evemaps.dotlan.net/system/{{ timer.system }}">{{ timer.system }} {{ timer.planet_moon }} </a>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{% ifequal timer.structure "POCO" %}
|
{% if timer.structure == "POCO" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POCO
|
POCO
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "I-HUB" %}
|
{% if timer.structure == "I-HUB" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
I-HUB
|
I-HUB
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "TCU" %}
|
{% if timer.structure == "TCU" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
TCU
|
TCU
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "POS[S]" %}
|
{% if timer.structure == "POS[S]" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POS [S]
|
POS [S]
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "POS[M]" %}
|
{% if timer.structure == "POS[M]" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POS [M]
|
POS [M]
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "POS[L]" %}
|
{% if timer.structure == "POS[L]" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POS [L]
|
POS [L]
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Citadel[M]" %}
|
{% if timer.structure == "Citadel[M]" or timer.structure == "Astrahus" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
Citadel [M]
|
Astrahus
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Citadel[L]" %}
|
{% if timer.structure == "Citadel[L]" or timer.structure == "Fortizar" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
Citadel [L]
|
Fortizar
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Citadel[XL]" %}
|
{% if timer.structure == "Citadel[XL]" or timer.structure == "Keepstar" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
Citadel [XL]
|
Keepstar
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Engineering Complex[M]" %}
|
{% if timer.structure == "Engineering Complex[M]" or timer.structure == "Raitaru" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Engineering Complex [M]
|
Raitaru
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Engineering Complex[L]" %}
|
{% if timer.structure == "Engineering Complex[L]" or timer.structure == "Azbel" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Engineering Complex [L]
|
Azbel
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Engineering Complex[XL]" %}
|
{% if timer.structure == "Engineering Complex[XL]" or timer.structure == "Sotiyo" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Engineering Complex [XL]
|
Sotiyo
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Refinery[M]" %}
|
{% if timer.structure == "Refinery[M]" or timer.structure == "Athanor" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Refinery [M]
|
Athanor
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Refinery[L]" %}
|
{% if timer.structure == "Refinery[L]" or timer.structure == "Tatara"%}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Refinery [L]
|
Tatara
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Cyno Beacon" %}
|
{% if timer.structure == "Cyno Beacon" or timer.structure == "Pharolux Cyno Beacon" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Cyno Beacon
|
Cyno Beacon
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Cyno Jammer" %}
|
{% if timer.structure == "Cyno Jammer" or timer.structure == "Tenebrex Cyno Jammer" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Cyno Jammer
|
Tenebrex Cyno Jammer
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Jump Gate" %}
|
{% if timer.structure == "Jump Gate" or timer.structure == "Ansiblex Jump Gate" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Jump Gate
|
Ansiblex Jump Gate
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Moon Mining Cycle" %}
|
{% if timer.structure == "Moon Mining Cycle" %}
|
||||||
<div class="label label-success">
|
<div class="label label-success">
|
||||||
Moon Mining Cycle
|
Moon Mining Cycle
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Other" %}
|
{% if timer.structure == "Other" %}
|
||||||
<div class="label label-default">
|
<div class="label label-default">
|
||||||
Other
|
Other
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
|
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
|
||||||
<td class="text-center" nowrap>
|
<td class="text-center" nowrap>
|
||||||
@@ -196,128 +196,128 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% for timer in future_timers %}
|
{% for timer in future_timers %}
|
||||||
{% ifequal timer.important True %}
|
{% if timer.important == True %}
|
||||||
<tr class="danger">
|
<tr class="danger">
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr class="info">
|
<tr class="info">
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
<td style="width:150px" class="text-center">{{ timer.details }}</td>
|
<td style="width:150px" class="text-center">{{ timer.details }}</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{% ifequal timer.objective "Hostile" %}
|
{% if timer.objective == "Hostile" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
{% trans "Hostile" %}
|
{% trans "Hostile" %}
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.objective "Friendly" %}
|
{% if timer.objective == "Friendly" %}
|
||||||
<div class="label label-primary">
|
<div class="label label-primary">
|
||||||
{% trans "Friendly" %}
|
{% trans "Friendly" %}
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.objective "Neutral" %}
|
{% if timer.objective == "Neutral" %}
|
||||||
<div class="label label-default">
|
<div class="label label-default">
|
||||||
{% trans "Neutral" %}
|
{% trans "Neutral" %}
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<a href="http://evemaps.dotlan.net/system/{{ timer.system }}">{{ timer.system }} {{ timer.planet_moon }}</a>
|
<a href="http://evemaps.dotlan.net/system/{{ timer.system }}">{{ timer.system }} {{ timer.planet_moon }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{% ifequal timer.structure "POCO" %}
|
{% if timer.structure == "POCO" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POCO
|
POCO
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "I-HUB" %}
|
{% if timer.structure == "I-HUB" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
I-HUB
|
I-HUB
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "TCU" %}
|
{% if timer.structure == "TCU" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
TCU
|
TCU
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "POS[S]" %}
|
{% if timer.structure == "POS[S]" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POS [S]
|
POS [S]
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "POS[M]" %}
|
{% if timer.structure == "POS[M]" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POS [M]
|
POS [M]
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "POS[L]" %}
|
{% if timer.structure == "POS[L]" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POS [L]
|
POS [L]
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Citadel[M]" %}
|
{% if timer.structure == "Citadel[M]" or timer.structure == "Astrahus" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
Citadel [M]
|
Astrahus
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Citadel[L]" %}
|
{% if timer.structure == "Citadel[L]" or timer.structure == "Fortizar" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
Citadel [L]
|
Fortizar
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Citadel[XL]" %}
|
{% if timer.structure == "Citadel[XL]" or timer.structure == "Keepstar" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
Citadel [XL]
|
Keepstar
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Engineering Complex[M]" %}
|
{% if timer.structure == "Engineering Complex[M]" or timer.structure == "Raitaru" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Engineering Complex [M]
|
Raitaru
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Engineering Complex[L]" %}
|
{% if timer.structure == "Engineering Complex[L]" or timer.structure == "Azbel" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Engineering Complex [L]
|
Azbel
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Engineering Complex[XL]" %}
|
{% if timer.structure == "Engineering Complex[XL]" or timer.structure == "Sotiyo" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Engineering Complex [XL]
|
Sotiyo
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Refinery[M]" %}
|
{% if timer.structure == "Refinery[M]" or timer.structure == "Athanor" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Refinery [M]
|
Athanor
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Refinery[L]" %}
|
{% if timer.structure == "Refinery[L]" or timer.structure == "Tatara" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Refinery [L]
|
Tatara
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Cyno Beacon" %}
|
{% if timer.structure == "Cyno Beacon" or timer.structure == "Pharolux Cyno Beacon" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Cyno Beacon
|
Pharolux Cyno Beacon
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Cyno Jammer" %}
|
{% if timer.structure == "Cyno Jammer" or timer.structure == "Tenebrex Cyno Jammer" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Cyno Jammer
|
Tenebrex Cyno Jammer
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Jump Gate" %}
|
{% if timer.structure == "Jump Gate" or timer.structure == "Ansiblex Jump Gate" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Jump Gate
|
Ansiblex Jump Gate
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Moon Mining Cycle" %}
|
{% if timer.structure == "Moon Mining Cycle" %}
|
||||||
<div class="label label-success">
|
<div class="label label-success">
|
||||||
Moon Mining Cycle
|
Moon Mining Cycle
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Other" %}
|
{% if timer.structure == "Other" %}
|
||||||
<div class="label label-default">
|
<div class="label label-default">
|
||||||
Other
|
Other
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
|
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
|
||||||
<td class="text-center" nowrap>
|
<td class="text-center" nowrap>
|
||||||
@@ -357,128 +357,128 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% for timer in past_timers %}
|
{% for timer in past_timers %}
|
||||||
{% ifequal timer.important True %}
|
{% if timer.important == True %}
|
||||||
<tr class="danger">
|
<tr class="danger">
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr class="info">
|
<tr class="info">
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
<td style="width:150px" class="text-center">{{ timer.details }}</td>
|
<td style="width:150px" class="text-center">{{ timer.details }}</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{% ifequal timer.objective "Hostile" %}
|
{% if timer.objective == "Hostile" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
{% trans "Hostile" %}
|
{% trans "Hostile" %}
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.objective "Friendly" %}
|
{% if timer.objective == "Friendly" %}
|
||||||
<div class="label label-primary">
|
<div class="label label-primary">
|
||||||
{% trans "Friendly" %}
|
{% trans "Friendly" %}
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.objective "Neutral" %}
|
{% if timer.objective == "Neutral" %}
|
||||||
<div class="label label-default">
|
<div class="label label-default">
|
||||||
{% trans "Neutral" %}
|
{% trans "Neutral" %}
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<a href="http://evemaps.dotlan.net/system/{{ timer.system }}">{{ timer.system }} {{ timer.planet_moon }}</a>
|
<a href="http://evemaps.dotlan.net/system/{{ timer.system }}">{{ timer.system }} {{ timer.planet_moon }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{% ifequal timer.structure "POCO" %}
|
{% if timer.structure == "POCO" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POCO
|
POCO
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "I-HUB" %}
|
{% if timer.structure == "I-HUB" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
I-HUB
|
I-HUB
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "TCU" %}
|
{% if timer.structure == "TCU" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
TCU
|
TCU
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "POS[S]" %}
|
{% if timer.structure == "POS[S]" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POS [S]
|
POS [S]
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "POS[M]" %}
|
{% if timer.structure == "POS[M]" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POS [M]
|
POS [M]
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "POS[L]" %}
|
{% if timer.structure == "POS[L]" %}
|
||||||
<div class="label label-info">
|
<div class="label label-info">
|
||||||
POS [L]
|
POS [L]
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Citadel[M]" %}
|
{% if timer.structure == "Citadel[M]" or timer.structure == "Astrahus" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
Citadel [M]
|
Astrahus
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Citadel[L]" %}
|
{% if timer.structure == "Citadel[L]" or timer.structure == "Fortizar" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
Citadel [L]
|
Fortizar
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Citadel[XL]" %}
|
{% if timer.structure == "Citadel[XL]" or timer.structure == "Keepstar" %}
|
||||||
<div class="label label-danger">
|
<div class="label label-danger">
|
||||||
Citadel [XL]
|
Keepstar
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Engineering Complex[M]" %}
|
{% if timer.structure == "Engineering Complex[M]" or timer.structure == "Raitaru" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Engineering Complex [M]
|
Raitaru
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Engineering Complex[L]" %}
|
{% if timer.structure == "Engineering Complex[L]" or timer.structure == "Azbel" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Engineering Complex [L]
|
Azbel
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Engineering Complex[XL]" %}
|
{% if timer.structure == "Engineering Complex[XL]" or timer.structure == "Sotiyo" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Engineering Complex [XL]
|
Sotiyo
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Refinery[M]" %}
|
{% if timer.structure == "Refinery[M]" or timer.structure == "Athanor" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Refinery [M]
|
Athanor
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Refinery[L]" %}
|
{% if timer.structure == "Refinery[L]" or timer.structure == "Tatara" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Refinery [L]
|
Tatara
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Cyno Beacon" %}
|
{% if timer.structure == "Cyno Beacon" or timer.structure == "Pharolux Cyno Beacon" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Cyno Beacon
|
Pharolux Cyno Beacon
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Cyno Jammer" %}
|
{% if timer.structure == "Cyno Jammer" or timer.structure == "Tenebrex Cyno Jammer" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Cyno Jammer
|
Tenebrex Cyno Jammer
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Jump Gate" %}
|
{% if timer.structure == "Jump Gate" or timer.structure == "Ansiblex Jump Gate" %}
|
||||||
<div class="label label-warning">
|
<div class="label label-warning">
|
||||||
Jump Gate
|
Ansiblex Jump Gate
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Moon Mining Cycle" %}
|
{% if timer.structure == "Moon Mining Cycle" %}
|
||||||
<div class="label label-success">
|
<div class="label label-success">
|
||||||
Moon Mining Cycle
|
Moon Mining Cycle
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal timer.structure "Other" %}
|
{% if timer.structure == "Other" %}
|
||||||
<div class="label label-default">
|
<div class="label label-default">
|
||||||
Other
|
Other
|
||||||
</div>
|
</div>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
|
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
|
||||||
<td class="text-center" nowrap>
|
<td class="text-center" nowrap>
|
||||||
|
|||||||
BIN
docs/_static/images/features/group_audit_log.png
vendored
Normal file
BIN
docs/_static/images/features/group_audit_log.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
@@ -66,6 +66,17 @@ Clicking on the blue eye will take you to the group member management screen. He
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
### Group Audit Log
|
||||||
|
Whenever a user Joins, Leaves, or is Removed from a group, this is logged. To find the audit log for a given group, click the light-blue button to the right of the Group Member Management (blue eye) button.
|
||||||
|
|
||||||
|
These logs contain the Date and Time the action was taken (in EVE/UTC), the user which submitted the request being acted upon (requestor), the user's main character, the type of request (join, leave or removed), the action taken (accept, reject or remove), and the user that took the action (actor).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```eval_rst
|
||||||
|
.. note::
|
||||||
|
There is no tracking for "Open" groups as members are able to freely join/leave these groups.
|
||||||
|
```
|
||||||
|
|
||||||
## Group Leaders
|
## Group Leaders
|
||||||
|
|
||||||
|
|||||||
@@ -71,9 +71,22 @@ CentOS:
|
|||||||
Alliance Auth needs a MySQL user account and database. Open an SQL shell with `mysql -u root -p` and create them as follows, replacing `PASSWORD` with an actual secure password:
|
Alliance Auth needs a MySQL user account and database. Open an SQL shell with `mysql -u root -p` and create them as follows, replacing `PASSWORD` with an actual secure password:
|
||||||
|
|
||||||
CREATE USER 'allianceserver'@'localhost' IDENTIFIED BY 'PASSWORD';
|
CREATE USER 'allianceserver'@'localhost' IDENTIFIED BY 'PASSWORD';
|
||||||
CREATE DATABASE alliance_auth CHARACTER SET utf8;
|
CREATE DATABASE alliance_auth CHARACTER SET utf8mb4;
|
||||||
GRANT ALL PRIVILEGES ON alliance_auth . * TO 'allianceserver'@'localhost';
|
GRANT ALL PRIVILEGES ON alliance_auth . * TO 'allianceserver'@'localhost';
|
||||||
|
|
||||||
|
Add timezone tables to your mysql installation:
|
||||||
|
|
||||||
|
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
|
||||||
|
|
||||||
|
```eval_rst
|
||||||
|
.. note::
|
||||||
|
You may see errors when you add the timezone tables. To make sure that they were correctly added run the following commands and check for the ``time_zone`` tables::
|
||||||
|
|
||||||
|
mysql -u root -p
|
||||||
|
use mysql;
|
||||||
|
show tables;
|
||||||
|
```
|
||||||
|
|
||||||
Close the SQL shell and secure your database server with the `mysql_secure_installation` command.
|
Close the SQL shell and secure your database server with the `mysql_secure_installation` command.
|
||||||
|
|
||||||
## Auth Install
|
## Auth Install
|
||||||
|
|||||||
@@ -6,6 +6,11 @@ Discord is very popular amongst ad-hoc small groups and larger organizations see
|
|||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
|
```eval_rst
|
||||||
|
.. warning::
|
||||||
|
Do not run the `discord.update_*` periodic tasks on a regular schedule, doing so can cause your discord service to stop syncing completely.
|
||||||
|
```
|
||||||
|
|
||||||
### Prepare Your Settings File
|
### Prepare Your Settings File
|
||||||
In your auth project's settings file, do the following:
|
In your auth project's settings file, do the following:
|
||||||
- Add `'allianceauth.services.modules.discord',` to your `INSTALLED_APPS` list
|
- Add `'allianceauth.services.modules.discord',` to your `INSTALLED_APPS` list
|
||||||
|
|||||||
7
setup.py
7
setup.py
@@ -13,20 +13,21 @@ install_requires = [
|
|||||||
'semantic_version',
|
'semantic_version',
|
||||||
|
|
||||||
'redis<=2.10.6',
|
'redis<=2.10.6',
|
||||||
'celery>=4.0.2',
|
'celery>=4.0.2,<4.3.0',
|
||||||
'celery_once',
|
'celery_once',
|
||||||
|
|
||||||
'django>=1.11,<=2.0.8',
|
'django>=2.0,<3.0',
|
||||||
'django-bootstrap-form',
|
'django-bootstrap-form',
|
||||||
'django-registration==2.4',
|
'django-registration==2.4',
|
||||||
'django-sortedm2m',
|
'django-sortedm2m',
|
||||||
'django-redis-cache>=1.7.1',
|
'django-redis-cache==1.8.1',
|
||||||
'django-celery-beat<=1.1.1',
|
'django-celery-beat<=1.1.1',
|
||||||
|
|
||||||
'openfire-restapi',
|
'openfire-restapi',
|
||||||
'sleekxmpp',
|
'sleekxmpp',
|
||||||
|
|
||||||
'adarnauth-esi>=1.4.10,<2.0',
|
'adarnauth-esi>=1.4.10,<2.0',
|
||||||
|
'kombu<=4.3.0',
|
||||||
]
|
]
|
||||||
|
|
||||||
testing_extras = [
|
testing_extras = [
|
||||||
|
|||||||
5
tox.ini
5
tox.ini
@@ -1,7 +1,7 @@
|
|||||||
[tox]
|
[tox]
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
envlist = py{34,35,36,37}-dj{111,20}
|
envlist = py{34,35,36,37}-dj{20}
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
setenv =
|
setenv =
|
||||||
@@ -12,8 +12,7 @@ basepython =
|
|||||||
py36: python3.6
|
py36: python3.6
|
||||||
py37: python3.7
|
py37: python3.7
|
||||||
deps=
|
deps=
|
||||||
dj111: Django>=1.11.1,<2.0
|
dj20: Django>=2.0,<3.0
|
||||||
dj20: Django>=2.0
|
|
||||||
py37: https://github.com/yaml/pyyaml/zipball/master#egg=pyyaml
|
py37: https://github.com/yaml/pyyaml/zipball/master#egg=pyyaml
|
||||||
py37: https://github.com/celery/kombu/zipball/master#egg=kombu
|
py37: https://github.com/celery/kombu/zipball/master#egg=kombu
|
||||||
install_command = pip install -e ".[testing]" -U {opts} {packages}
|
install_command = pip install -e ".[testing]" -U {opts} {packages}
|
||||||
|
|||||||
Reference in New Issue
Block a user