Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1e8903128 | ||
|
|
b00ac2aef4 | ||
|
|
8865d15ed9 | ||
|
|
fc3d4b7f33 | ||
|
|
934cc44540 | ||
|
|
106de3dd4c | ||
|
|
9b55cfcbe3 | ||
|
|
8137f1023a | ||
|
|
d670e33b6f | ||
|
|
3d3bb8fc94 | ||
|
|
9c880eae8a | ||
|
|
54a71630f1 | ||
|
|
923a8453cc | ||
|
|
00447ca819 | ||
|
|
ad4ee9d822 | ||
|
|
40e9dbfda2 | ||
|
|
b9da6911e6 | ||
|
|
81f9211098 | ||
|
|
8290081365 | ||
|
|
81af610c11 | ||
|
|
cfa2cf58f3 | ||
|
|
01c17d28f6 |
3
.gitignore
vendored
@@ -69,3 +69,6 @@ celerybeat-schedule
|
||||
|
||||
#gitlab configs
|
||||
.gitlab/
|
||||
|
||||
#transifex
|
||||
.tx/
|
||||
|
||||
@@ -6,25 +6,45 @@ before_script:
|
||||
- python -V
|
||||
- pip install wheel tox
|
||||
|
||||
test-3.5:
|
||||
test-3.5-core:
|
||||
image: python:3.5-buster
|
||||
script:
|
||||
- tox -e py35
|
||||
- tox -e py35-core
|
||||
|
||||
test-3.6:
|
||||
test-3.6-core:
|
||||
image: python:3.6-buster
|
||||
script:
|
||||
- tox -e py36
|
||||
- tox -e py36-core
|
||||
|
||||
test-3.7:
|
||||
test-3.7-core:
|
||||
image: python:3.7-buster
|
||||
script:
|
||||
- tox -e py37
|
||||
- tox -e py37-core
|
||||
|
||||
test-3.8:
|
||||
test-3.8-core:
|
||||
image: python:3.8-buster
|
||||
script:
|
||||
- tox -e py38
|
||||
- tox -e py38-core
|
||||
|
||||
test-3.5-all:
|
||||
image: python:3.5-buster
|
||||
script:
|
||||
- tox -e py35-all
|
||||
|
||||
test-3.6-all:
|
||||
image: python:3.6-buster
|
||||
script:
|
||||
- tox -e py36-all
|
||||
|
||||
test-3.7-all:
|
||||
image: python:3.7-buster
|
||||
script:
|
||||
- tox -e py37-all
|
||||
|
||||
test-3.8-all:
|
||||
image: python:3.8-buster
|
||||
script:
|
||||
- tox -e py38-all
|
||||
|
||||
deploy_production:
|
||||
stage: deploy
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# This will make sure the app is always imported when
|
||||
# Django starts so that shared_task will use this app.
|
||||
|
||||
__version__ = '2.6.0'
|
||||
__version__ = '2.6.2'
|
||||
NAME = 'Alliance Auth v%s' % __version__
|
||||
default_app_config = 'allianceauth.apps.AllianceAuthConfig'
|
||||
|
||||
@@ -18,14 +18,14 @@ from django.utils.text import slugify
|
||||
from allianceauth.authentication.models import State, get_guest_state,\
|
||||
CharacterOwnership, UserProfile, OwnershipRecord
|
||||
from allianceauth.hooks import get_hooks
|
||||
from allianceauth.eveonline.models import EveCharacter, EveCorporationInfo
|
||||
from allianceauth.eveonline.models import EveCharacter, EveCorporationInfo,\
|
||||
EveAllianceInfo
|
||||
from allianceauth.eveonline.tasks import update_character
|
||||
from .app_settings import AUTHENTICATION_ADMIN_USERS_MAX_GROUPS, \
|
||||
AUTHENTICATION_ADMIN_USERS_MAX_CHARS
|
||||
|
||||
if 'allianceauth.eveonline.autogroups' in settings.INSTALLED_APPS:
|
||||
_has_auto_groups = True
|
||||
from allianceauth.eveonline.autogroups.models import *
|
||||
_has_auto_groups = True
|
||||
else:
|
||||
_has_auto_groups = False
|
||||
|
||||
@@ -241,6 +241,22 @@ class MainAllianceFilter(admin.SimpleListFilter):
|
||||
self.value())
|
||||
|
||||
|
||||
def update_main_character_model(modeladmin, request, queryset):
|
||||
tasks_count = 0
|
||||
for obj in queryset:
|
||||
if obj.profile.main_character:
|
||||
update_character.delay(obj.profile.main_character.character_id)
|
||||
tasks_count += 1
|
||||
|
||||
modeladmin.message_user(
|
||||
request,
|
||||
'Update from ESI started for {} characters'.format(tasks_count)
|
||||
)
|
||||
|
||||
update_main_character_model.short_description = \
|
||||
'Update main character model from ESI'
|
||||
|
||||
|
||||
class UserAdmin(BaseUserAdmin):
|
||||
"""Extending Django's UserAdmin model
|
||||
|
||||
@@ -272,28 +288,13 @@ class UserAdmin(BaseUserAdmin):
|
||||
else:
|
||||
return queryset.filter(groups__pk=self.value())
|
||||
|
||||
def update_main_character_model(self, request, queryset):
|
||||
tasks_count = 0
|
||||
for obj in queryset:
|
||||
if obj.profile.main_character:
|
||||
update_character.delay(obj.profile.main_character.character_id)
|
||||
tasks_count += 1
|
||||
|
||||
self.message_user(
|
||||
request,
|
||||
'Update from ESI started for {} characters'.format(tasks_count)
|
||||
)
|
||||
|
||||
update_main_character_model.short_description = \
|
||||
'Update main character model from ESI'
|
||||
|
||||
def get_actions(self, request):
|
||||
actions = super(BaseUserAdmin, self).get_actions(request)
|
||||
|
||||
actions[self.update_main_character_model.__name__] = (
|
||||
self.update_main_character_model,
|
||||
self.update_main_character_model.__name__,
|
||||
self.update_main_character_model.short_description
|
||||
actions[update_main_character_model.__name__] = (
|
||||
update_main_character_model,
|
||||
update_main_character_model.__name__,
|
||||
update_main_character_model.short_description
|
||||
)
|
||||
|
||||
for hook in get_hooks('services_hook'):
|
||||
|
||||
@@ -94,12 +94,12 @@
|
||||
<div class="col-sm-6 text-center">
|
||||
<div class="panel panel-success" style="height:100%">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{% trans "Groups" %}</h3>
|
||||
<h3 class="panel-title">{% trans "Group Memberships" %}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div style="height: 240px;overflow:-moz-scrollbars-vertical;overflow-y:auto;">
|
||||
<table class="table table-aa">
|
||||
{% for group in user.groups.all %}
|
||||
{% for group in groups %}
|
||||
<tr>
|
||||
<td>{{ group.name }}</td>
|
||||
</tr>
|
||||
@@ -128,16 +128,14 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for ownership in request.user.character_ownerships.all %}
|
||||
{% with ownership.character as char %}
|
||||
<tr>
|
||||
<td class="text-center"><img class="ra-avatar img-circle" src="{{ char.portrait_url_32 }}">
|
||||
</td>
|
||||
<td class="text-center">{{ char.character_name }}</td>
|
||||
<td class="text-center">{{ char.corporation_name }}</td>
|
||||
<td class="text-center">{{ char.alliance_name }}</td>
|
||||
</tr>
|
||||
{% endwith %}
|
||||
{% for char in characters %}
|
||||
<tr>
|
||||
<td class="text-center"><img class="ra-avatar img-circle" src="{{ char.portrait_url_32 }}">
|
||||
</td>
|
||||
<td class="text-center">{{ char.character_name }}</td>
|
||||
<td class="text-center">{{ char.corporation_name }}</td>
|
||||
<td class="text-center">{{ char.alliance_name }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% load i18n %}{% autoescape off %}
|
||||
{% blocktrans %}You're receiving this email because you requested a password reset for your
|
||||
{% blocktrans trimmed %}You're receiving this email because you requested a password reset for your
|
||||
user account.{% endblocktrans %}
|
||||
|
||||
{% trans "Please go to the following page and choose a new password:" %}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
from django.urls import reverse
|
||||
|
||||
|
||||
def get_admin_change_view_url(obj: object) -> str:
|
||||
return reverse(
|
||||
'admin:{}_{}_change'.format(
|
||||
obj._meta.app_label,
|
||||
type(obj).__name__.lower()
|
||||
),
|
||||
args=(obj.pk,)
|
||||
)
|
||||
@@ -1,187 +1,282 @@
|
||||
from unittest.mock import patch
|
||||
|
||||
from django.test import TestCase, RequestFactory
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.contrib.admin.sites import AdminSite
|
||||
from django.contrib.auth.models import User as BaseUser, Group
|
||||
from django.test import TestCase, RequestFactory, Client
|
||||
|
||||
from allianceauth.authentication.models import CharacterOwnership, State
|
||||
from allianceauth.eveonline.autogroups.models import AutogroupsConfig
|
||||
from allianceauth.authentication.models import CharacterOwnership, State, \
|
||||
OwnershipRecord
|
||||
from allianceauth.eveonline.models import (
|
||||
EveCharacter, EveCorporationInfo, EveAllianceInfo
|
||||
)
|
||||
from allianceauth.tests.auth_utils import AuthUtils
|
||||
|
||||
from ..admin import (
|
||||
BaseUserAdmin,
|
||||
BaseUserAdmin,
|
||||
CharacterOwnershipAdmin,
|
||||
PermissionAdmin,
|
||||
StateAdmin,
|
||||
MainCorporationsFilter,
|
||||
MainAllianceFilter,
|
||||
OwnershipRecordAdmin,
|
||||
User,
|
||||
UserAdmin,
|
||||
user_main_organization,
|
||||
user_profile_pic,
|
||||
user_username,
|
||||
user_username,
|
||||
update_main_character_model
|
||||
)
|
||||
from . import get_admin_change_view_url
|
||||
|
||||
if 'allianceauth.eveonline.autogroups' in settings.INSTALLED_APPS:
|
||||
_has_auto_groups = True
|
||||
from allianceauth.eveonline.autogroups.models import AutogroupsConfig
|
||||
else:
|
||||
_has_auto_groups = False
|
||||
|
||||
MODULE_PATH = 'allianceauth.authentication.admin'
|
||||
|
||||
|
||||
class MockRequest(object):
|
||||
|
||||
class MockRequest(object):
|
||||
def __init__(self, user=None):
|
||||
self.user = user
|
||||
|
||||
|
||||
def create_test_data():
|
||||
# groups
|
||||
group_1 = Group.objects.create(
|
||||
name='Group 1'
|
||||
)
|
||||
group_2 = Group.objects.create(
|
||||
name='Group 2'
|
||||
)
|
||||
|
||||
# user 1 - corp and alliance, normal user
|
||||
character_1 = EveCharacter.objects.create(
|
||||
character_id='1001',
|
||||
character_name='Bruce Wayne',
|
||||
corporation_id='2001',
|
||||
corporation_name='Wayne Technologies',
|
||||
corporation_ticker='WT',
|
||||
alliance_id='3001',
|
||||
alliance_name='Wayne Enterprises',
|
||||
alliance_ticker='WE',
|
||||
)
|
||||
character_1a = EveCharacter.objects.create(
|
||||
character_id='1002',
|
||||
character_name='Batman',
|
||||
corporation_id='2001',
|
||||
corporation_name='Wayne Technologies',
|
||||
corporation_ticker='WT',
|
||||
alliance_id='3001',
|
||||
alliance_name='Wayne Enterprises',
|
||||
alliance_ticker='WE',
|
||||
)
|
||||
alliance = EveAllianceInfo.objects.create(
|
||||
alliance_id='3001',
|
||||
alliance_name='Wayne Enterprises',
|
||||
alliance_ticker='WE',
|
||||
executor_corp_id='2001'
|
||||
)
|
||||
EveCorporationInfo.objects.create(
|
||||
corporation_id='2001',
|
||||
corporation_name='Wayne Technologies',
|
||||
corporation_ticker='WT',
|
||||
member_count=42,
|
||||
alliance=alliance
|
||||
)
|
||||
user_1 = User.objects.create_user(
|
||||
character_1.character_name.replace(' ', '_'),
|
||||
'abc@example.com',
|
||||
'password'
|
||||
)
|
||||
CharacterOwnership.objects.create(
|
||||
character=character_1,
|
||||
owner_hash='x1' + character_1.character_name,
|
||||
user=user_1
|
||||
)
|
||||
CharacterOwnership.objects.create(
|
||||
character=character_1a,
|
||||
owner_hash='x1' + character_1a.character_name,
|
||||
user=user_1
|
||||
)
|
||||
user_1.profile.main_character = character_1
|
||||
user_1.profile.save()
|
||||
user_1.groups.add(group_1)
|
||||
|
||||
# user 2 - corp only, staff
|
||||
character_2 = EveCharacter.objects.create(
|
||||
character_id=1003,
|
||||
character_name='Clark Kent',
|
||||
corporation_id=2002,
|
||||
corporation_name='Daily Planet',
|
||||
corporation_ticker='DP',
|
||||
alliance_id=None
|
||||
)
|
||||
EveCorporationInfo.objects.create(
|
||||
corporation_id=2002,
|
||||
corporation_name='Daily Plane',
|
||||
corporation_ticker='DP',
|
||||
member_count=99,
|
||||
alliance=None
|
||||
)
|
||||
user_2 = User.objects.create_user(
|
||||
character_2.character_name.replace(' ', '_'),
|
||||
'abc@example.com',
|
||||
'password'
|
||||
)
|
||||
CharacterOwnership.objects.create(
|
||||
character=character_2,
|
||||
owner_hash='x1' + character_2.character_name,
|
||||
user=user_2
|
||||
)
|
||||
user_2.profile.main_character = character_2
|
||||
user_2.profile.save()
|
||||
user_2.groups.add(group_2)
|
||||
user_2.is_staff = True
|
||||
user_2.save()
|
||||
|
||||
# user 3 - no main, no group, superuser
|
||||
character_3 = EveCharacter.objects.create(
|
||||
character_id=1101,
|
||||
character_name='Lex Luthor',
|
||||
corporation_id=2101,
|
||||
corporation_name='Lex Corp',
|
||||
corporation_ticker='LC',
|
||||
alliance_id=None
|
||||
)
|
||||
EveCorporationInfo.objects.create(
|
||||
corporation_id=2101,
|
||||
corporation_name='Lex Corp',
|
||||
corporation_ticker='LC',
|
||||
member_count=666,
|
||||
alliance=None
|
||||
)
|
||||
EveAllianceInfo.objects.create(
|
||||
alliance_id='3101',
|
||||
alliance_name='Lex World Domination',
|
||||
alliance_ticker='LWD',
|
||||
executor_corp_id=''
|
||||
)
|
||||
user_3 = User.objects.create_user(
|
||||
character_3.character_name.replace(' ', '_'),
|
||||
'abc@example.com',
|
||||
'password'
|
||||
)
|
||||
CharacterOwnership.objects.create(
|
||||
character=character_3,
|
||||
owner_hash='x1' + character_3.character_name,
|
||||
user=user_3
|
||||
)
|
||||
user_3.is_superuser = True
|
||||
user_3.save()
|
||||
return user_1, user_2, user_3, group_1, group_2
|
||||
|
||||
|
||||
class TestCharacterOwnershipAdmin(TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.user_1, _, _, _, _ = create_test_data()
|
||||
|
||||
def setUp(self):
|
||||
self.modeladmin = CharacterOwnershipAdmin(
|
||||
model=User, admin_site=AdminSite()
|
||||
)
|
||||
|
||||
def test_change_view_loads_normally(self):
|
||||
User.objects.create_superuser(
|
||||
username='superuser', password='secret', email='admin@example.com'
|
||||
)
|
||||
c = Client()
|
||||
c.login(username='superuser', password='secret')
|
||||
ownership = self.user_1.character_ownerships.first()
|
||||
response = c.get(get_admin_change_view_url(ownership))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
|
||||
class TestOwnershipRecordAdmin(TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.user_1, _, _, _, _ = create_test_data()
|
||||
|
||||
def setUp(self):
|
||||
self.modeladmin = OwnershipRecordAdmin(
|
||||
model=User, admin_site=AdminSite()
|
||||
)
|
||||
|
||||
def test_change_view_loads_normally(self):
|
||||
User.objects.create_superuser(
|
||||
username='superuser', password='secret', email='admin@example.com'
|
||||
)
|
||||
c = Client()
|
||||
c.login(username='superuser', password='secret')
|
||||
ownership_record = OwnershipRecord.objects\
|
||||
.filter(user=self.user_1)\
|
||||
.first()
|
||||
response = c.get(get_admin_change_view_url(ownership_record))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
|
||||
class TestStateAdmin(TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
create_test_data()
|
||||
|
||||
def setUp(self):
|
||||
self.modeladmin = StateAdmin(
|
||||
model=User, admin_site=AdminSite()
|
||||
)
|
||||
|
||||
def test_change_view_loads_normally(self):
|
||||
User.objects.create_superuser(
|
||||
username='superuser', password='secret', email='admin@example.com'
|
||||
)
|
||||
c = Client()
|
||||
c.login(username='superuser', password='secret')
|
||||
|
||||
guest_state = AuthUtils.get_guest_state()
|
||||
response = c.get(get_admin_change_view_url(guest_state))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
member_state = AuthUtils.get_member_state()
|
||||
response = c.get(get_admin_change_view_url(member_state))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
|
||||
class TestUserAdmin(TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
|
||||
# groups
|
||||
cls.group_1 = Group.objects.create(
|
||||
name='Group 1'
|
||||
)
|
||||
cls.group_2 = Group.objects.create(
|
||||
name='Group 2'
|
||||
)
|
||||
|
||||
# user 1 - corp and alliance, normal user
|
||||
cls.character_1 = EveCharacter.objects.create(
|
||||
character_id='1001',
|
||||
character_name='Bruce Wayne',
|
||||
corporation_id='2001',
|
||||
corporation_name='Wayne Technologies',
|
||||
corporation_ticker='WT',
|
||||
alliance_id='3001',
|
||||
alliance_name='Wayne Enterprises',
|
||||
alliance_ticker='WE',
|
||||
)
|
||||
cls.character_1a = EveCharacter.objects.create(
|
||||
character_id='1002',
|
||||
character_name='Batman',
|
||||
corporation_id='2001',
|
||||
corporation_name='Wayne Technologies',
|
||||
corporation_ticker='WT',
|
||||
alliance_id='3001',
|
||||
alliance_name='Wayne Enterprises',
|
||||
alliance_ticker='WE',
|
||||
)
|
||||
alliance = EveAllianceInfo.objects.create(
|
||||
alliance_id='3001',
|
||||
alliance_name='Wayne Enterprises',
|
||||
alliance_ticker='WE',
|
||||
executor_corp_id='2001'
|
||||
)
|
||||
EveCorporationInfo.objects.create(
|
||||
corporation_id='2001',
|
||||
corporation_name='Wayne Technologies',
|
||||
corporation_ticker='WT',
|
||||
member_count=42,
|
||||
alliance=alliance
|
||||
)
|
||||
cls.user_1 = User.objects.create_user(
|
||||
cls.character_1.character_name.replace(' ', '_'),
|
||||
'abc@example.com',
|
||||
'password'
|
||||
)
|
||||
CharacterOwnership.objects.create(
|
||||
character=cls.character_1,
|
||||
owner_hash='x1' + cls.character_1.character_name,
|
||||
user=cls.user_1
|
||||
)
|
||||
CharacterOwnership.objects.create(
|
||||
character=cls.character_1a,
|
||||
owner_hash='x1' + cls.character_1a.character_name,
|
||||
user=cls.user_1
|
||||
)
|
||||
cls.user_1.profile.main_character = cls.character_1
|
||||
cls.user_1.profile.save()
|
||||
cls.user_1.groups.add(cls.group_1)
|
||||
|
||||
# user 2 - corp only, staff
|
||||
cls.character_2 = EveCharacter.objects.create(
|
||||
character_id=1003,
|
||||
character_name='Clark Kent',
|
||||
corporation_id=2002,
|
||||
corporation_name='Daily Planet',
|
||||
corporation_ticker='DP',
|
||||
alliance_id=None
|
||||
)
|
||||
EveCorporationInfo.objects.create(
|
||||
corporation_id=2002,
|
||||
corporation_name='Daily Plane',
|
||||
corporation_ticker='DP',
|
||||
member_count=99,
|
||||
alliance=None
|
||||
)
|
||||
cls.user_2 = User.objects.create_user(
|
||||
cls.character_2.character_name.replace(' ', '_'),
|
||||
'abc@example.com',
|
||||
'password'
|
||||
)
|
||||
CharacterOwnership.objects.create(
|
||||
character=cls.character_2,
|
||||
owner_hash='x1' + cls.character_2.character_name,
|
||||
user=cls.user_2
|
||||
)
|
||||
cls.user_2.profile.main_character = cls.character_2
|
||||
cls.user_2.profile.save()
|
||||
cls.user_2.groups.add(cls.group_2)
|
||||
cls.user_2.is_staff = True
|
||||
cls.user_2.save()
|
||||
|
||||
# user 3 - no main, no group, superuser
|
||||
cls.character_3 = EveCharacter.objects.create(
|
||||
character_id=1101,
|
||||
character_name='Lex Luthor',
|
||||
corporation_id=2101,
|
||||
corporation_name='Lex Corp',
|
||||
corporation_ticker='LC',
|
||||
alliance_id=None
|
||||
)
|
||||
EveCorporationInfo.objects.create(
|
||||
corporation_id=2101,
|
||||
corporation_name='Lex Corp',
|
||||
corporation_ticker='LC',
|
||||
member_count=666,
|
||||
alliance=None
|
||||
)
|
||||
EveAllianceInfo.objects.create(
|
||||
alliance_id='3101',
|
||||
alliance_name='Lex World Domination',
|
||||
alliance_ticker='LWD',
|
||||
executor_corp_id=''
|
||||
)
|
||||
cls.user_3 = User.objects.create_user(
|
||||
cls.character_3.character_name.replace(' ', '_'),
|
||||
'abc@example.com',
|
||||
'password'
|
||||
)
|
||||
CharacterOwnership.objects.create(
|
||||
character=cls.character_3,
|
||||
owner_hash='x1' + cls.character_3.character_name,
|
||||
user=cls.user_3
|
||||
)
|
||||
cls.user_3.is_superuser = True
|
||||
cls.user_3.save()
|
||||
super().setUpClass()
|
||||
cls.user_1, cls.user_2, cls.user_3, cls.group_1, cls.group_2 = \
|
||||
create_test_data()
|
||||
|
||||
def setUp(self):
|
||||
self.factory = RequestFactory()
|
||||
self.modeladmin = UserAdmin(
|
||||
model=User, admin_site=AdminSite()
|
||||
)
|
||||
self.character_1 = self.user_1.character_ownerships.first().character
|
||||
|
||||
def _create_autogroups(self):
|
||||
"""create autogroups for corps and alliances"""
|
||||
autogroups_config = AutogroupsConfig(
|
||||
corp_groups = True,
|
||||
alliance_groups = True
|
||||
)
|
||||
autogroups_config.save()
|
||||
for state in State.objects.all():
|
||||
autogroups_config.states.add(state)
|
||||
autogroups_config.update_corp_group_membership(self.user_1)
|
||||
if _has_auto_groups:
|
||||
autogroups_config = AutogroupsConfig(
|
||||
corp_groups = True,
|
||||
alliance_groups = True
|
||||
)
|
||||
autogroups_config.save()
|
||||
for state in State.objects.all():
|
||||
autogroups_config.states.add(state)
|
||||
autogroups_config.update_corp_group_membership(self.user_1)
|
||||
|
||||
# column rendering
|
||||
|
||||
@@ -315,8 +410,8 @@ class TestUserAdmin(TestCase):
|
||||
self, mock_task, mock_message_user
|
||||
):
|
||||
users_qs = User.objects.filter(pk__in=[self.user_1.pk, self.user_2.pk])
|
||||
self.modeladmin.update_main_character_model(
|
||||
MockRequest(self.user_1), users_qs
|
||||
update_main_character_model(
|
||||
self.modeladmin, MockRequest(self.user_1), users_qs
|
||||
)
|
||||
self.assertEqual(mock_task.delay.call_count, 2)
|
||||
self.assertTrue(mock_message_user.called)
|
||||
@@ -436,4 +531,13 @@ class TestUserAdmin(TestCase):
|
||||
changelist = my_modeladmin.get_changelist_instance(request)
|
||||
queryset = changelist.get_queryset(request)
|
||||
expected = [self.user_1]
|
||||
self.assertSetEqual(set(queryset), set(expected))
|
||||
self.assertSetEqual(set(queryset), set(expected))
|
||||
|
||||
def test_change_view_loads_normally(self):
|
||||
User.objects.create_superuser(
|
||||
username='superuser', password='secret', email='admin@example.com'
|
||||
)
|
||||
c = Client()
|
||||
c.login(username='superuser', password='secret')
|
||||
response = c.get(get_admin_change_view_url(self.user_1))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
from django.test import TestCase
|
||||
|
||||
from .. import app_settings
|
||||
|
||||
MODULE_PATH = 'allianceauth.authentication'
|
||||
|
||||
|
||||
class TestSetAppSetting(TestCase):
|
||||
|
||||
@patch(MODULE_PATH + '.app_settings.settings')
|
||||
@@ -17,7 +17,6 @@ class TestSetAppSetting(TestCase):
|
||||
)
|
||||
self.assertEqual(result, False)
|
||||
|
||||
|
||||
@patch(MODULE_PATH + '.app_settings.settings')
|
||||
def test_default_if_not_set_for_none(self, mock_settings):
|
||||
mock_settings.TEST_SETTING_DUMMY = Mock(spec=None)
|
||||
@@ -28,7 +27,6 @@ class TestSetAppSetting(TestCase):
|
||||
)
|
||||
self.assertEqual(result, None)
|
||||
|
||||
|
||||
@patch(MODULE_PATH + '.app_settings.settings')
|
||||
def test_true_stays_true(self, mock_settings):
|
||||
mock_settings.TEST_SETTING_DUMMY = True
|
||||
@@ -56,7 +54,6 @@ class TestSetAppSetting(TestCase):
|
||||
)
|
||||
self.assertEqual(result, False)
|
||||
|
||||
|
||||
@patch(MODULE_PATH + '.app_settings.settings')
|
||||
def test_default_for_invalid_type_int(self, mock_settings):
|
||||
mock_settings.TEST_SETTING_DUMMY = 'invalid type'
|
||||
@@ -95,7 +92,6 @@ class TestSetAppSetting(TestCase):
|
||||
)
|
||||
self.assertEqual(result, 50)
|
||||
|
||||
|
||||
@patch(MODULE_PATH + '.app_settings.settings')
|
||||
def test_default_is_none_needs_required_type(self, mock_settings):
|
||||
mock_settings.TEST_SETTING_DUMMY = 'invalid type'
|
||||
@@ -104,5 +100,3 @@ class TestSetAppSetting(TestCase):
|
||||
'TEST_SETTING_DUMMY',
|
||||
default_value=None
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -7,11 +7,28 @@ from . import views
|
||||
app_name = 'authentication'
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', login_required(TemplateView.as_view(template_name='authentication/dashboard.html')),),
|
||||
url(r'^account/login/$', TemplateView.as_view(template_name='public/login.html'), name='login'),
|
||||
url(r'^account/characters/main/$', views.main_character_change, name='change_main_character'),
|
||||
url(r'^account/characters/add/$', views.add_character, name='add_character'),
|
||||
url(r'^help/$', login_required(TemplateView.as_view(template_name='allianceauth/help.html')), name='help'),
|
||||
url(r'^dashboard/$',
|
||||
login_required(TemplateView.as_view(template_name='authentication/dashboard.html')), name='dashboard'),
|
||||
url(r'^$', views.index, name='index'),
|
||||
url(
|
||||
r'^account/login/$',
|
||||
TemplateView.as_view(template_name='public/login.html'),
|
||||
name='login'
|
||||
),
|
||||
url(
|
||||
r'^account/characters/main/$',
|
||||
views.main_character_change,
|
||||
name='change_main_character'
|
||||
),
|
||||
url(
|
||||
r'^account/characters/add/$',
|
||||
views.add_character,
|
||||
name='add_character'
|
||||
),
|
||||
url(
|
||||
r'^help/$',
|
||||
login_required(
|
||||
TemplateView.as_view(template_name='allianceauth/help.html')
|
||||
),
|
||||
name='help'
|
||||
),
|
||||
url(r'^dashboard/$', views.dashboard, name='dashboard'),
|
||||
]
|
||||
|
||||
@@ -7,20 +7,58 @@ from django.contrib.auth.decorators import login_required
|
||||
from django.contrib.auth.models import User
|
||||
from django.core import signing
|
||||
from django.urls import reverse
|
||||
from django.shortcuts import redirect
|
||||
from django.shortcuts import redirect, render
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from allianceauth.eveonline.models import EveCharacter
|
||||
from esi.decorators import token_required
|
||||
from esi.models import Token
|
||||
from registration.backends.hmac.views import RegistrationView as BaseRegistrationView, \
|
||||
ActivationView as BaseActivationView, REGISTRATION_SALT
|
||||
|
||||
from registration.backends.hmac.views import (
|
||||
RegistrationView as BaseRegistrationView,
|
||||
ActivationView as BaseActivationView,
|
||||
REGISTRATION_SALT
|
||||
)
|
||||
from registration.signals import user_registered
|
||||
|
||||
from .models import CharacterOwnership
|
||||
from .forms import RegistrationForm
|
||||
|
||||
if 'allianceauth.eveonline.autogroups' in settings.INSTALLED_APPS:
|
||||
_has_auto_groups = True
|
||||
from allianceauth.eveonline.autogroups.models import *
|
||||
else:
|
||||
_has_auto_groups = False
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@login_required
|
||||
def index(request):
|
||||
return redirect('authentication:dashboard')
|
||||
|
||||
|
||||
@login_required
|
||||
def dashboard(request):
|
||||
groups = request.user.groups.all()
|
||||
if _has_auto_groups:
|
||||
groups = groups\
|
||||
.filter(managedalliancegroup__isnull=True)\
|
||||
.filter(managedcorpgroup__isnull=True)
|
||||
groups = groups.order_by('name')
|
||||
characters = EveCharacter.objects\
|
||||
.filter(character_ownership__user=request.user)\
|
||||
.select_related()\
|
||||
.order_by('character_name')
|
||||
|
||||
context = {
|
||||
'groups': groups,
|
||||
'characters': characters
|
||||
}
|
||||
return render(request, 'authentication/dashboard.html', context)
|
||||
|
||||
|
||||
@login_required
|
||||
@token_required(scopes=settings.LOGIN_TOKEN_SCOPES)
|
||||
def main_character_change(request, token):
|
||||
|
||||
@@ -15,7 +15,13 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
</h1>
|
||||
<h2>{% blocktrans %}{{ user }} has collected {{ n_fats }} link{{ n_fats|pluralize }} this month.{% endblocktrans %}</h2>
|
||||
<h2>
|
||||
{% blocktrans count links=n_fats trimmed %}
|
||||
{{ user }} has collected one link this month.
|
||||
{% plural %}
|
||||
{{ user }} has collected {{ links }} links this month.
|
||||
{% endblocktrans %}
|
||||
</h2>
|
||||
<table class="table table-responsive">
|
||||
<tr>
|
||||
<th class="col-md-2 text-center">{% trans "Ship" %}</th>
|
||||
@@ -29,7 +35,13 @@
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% if created_fats %}
|
||||
<h2>{% blocktrans %}{{ user }} has created {{ n_created_fats }} link{{ n_created_fats|pluralize }} this month.{% endblocktrans %}</h2>
|
||||
<h2>
|
||||
{% blocktrans count links=n_created_fats trimmed %}
|
||||
{{ user }} has created one link this month.
|
||||
{% plural %}
|
||||
{{ user }} has created {{ links }} links this month.
|
||||
{% endblocktrans %}
|
||||
</h2>
|
||||
{% if created_fats %}
|
||||
<table class="table">
|
||||
<tr>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.conf import settings
|
||||
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.models import Group as BaseGroup
|
||||
from django.contrib.auth.models import Group as BaseGroup, User
|
||||
from django.db.models import Count
|
||||
from django.db.models.functions import Lower
|
||||
from django.db.models.signals import pre_save, post_save, pre_delete, \
|
||||
@@ -13,8 +13,7 @@ from .models import GroupRequest
|
||||
from . import signals
|
||||
|
||||
if 'allianceauth.eveonline.autogroups' in settings.INSTALLED_APPS:
|
||||
_has_auto_groups = True
|
||||
from allianceauth.eveonline.autogroups.models import *
|
||||
_has_auto_groups = True
|
||||
else:
|
||||
_has_auto_groups = False
|
||||
|
||||
@@ -22,19 +21,24 @@ else:
|
||||
class AuthGroupInlineAdmin(admin.StackedInline):
|
||||
model = AuthGroup
|
||||
filter_horizontal = ('group_leaders', 'group_leader_groups', 'states',)
|
||||
fields = ('description', 'group_leaders', 'group_leader_groups', 'states', 'internal', 'hidden', 'open', 'public')
|
||||
fields = (
|
||||
'description',
|
||||
'group_leaders',
|
||||
'group_leader_groups',
|
||||
'states', 'internal',
|
||||
'hidden',
|
||||
'open',
|
||||
'public'
|
||||
)
|
||||
verbose_name_plural = 'Auth Settings'
|
||||
verbose_name = ''
|
||||
|
||||
def formfield_for_manytomany(self, db_field, request, **kwargs):
|
||||
"""overriding this formfield to have sorted lists in the form"""
|
||||
if db_field.name == "group_leaders":
|
||||
kwargs["queryset"] = User.objects\
|
||||
.filter(profile__state__name='Member')\
|
||||
.order_by(Lower('username'))
|
||||
kwargs["queryset"] = User.objects.order_by(Lower('username'))
|
||||
elif db_field.name == "group_leader_groups":
|
||||
kwargs["queryset"] = Group.objects\
|
||||
.order_by(Lower('name'))
|
||||
kwargs["queryset"] = Group.objects.order_by(Lower('name'))
|
||||
return super().formfield_for_manytomany(db_field, request, **kwargs)
|
||||
|
||||
def has_add_permission(self, request):
|
||||
@@ -103,14 +107,16 @@ class GroupAdmin(admin.ModelAdmin):
|
||||
'_member_count',
|
||||
'has_leader'
|
||||
)
|
||||
list_filter = (
|
||||
list_filter = [
|
||||
'authgroup__internal',
|
||||
'authgroup__hidden',
|
||||
'authgroup__open',
|
||||
'authgroup__public',
|
||||
IsAutoGroupFilter,
|
||||
HasLeaderFilter
|
||||
)
|
||||
'authgroup__public',
|
||||
]
|
||||
if _has_auto_groups:
|
||||
list_filter.append(IsAutoGroupFilter)
|
||||
list_filter.append(HasLeaderFilter)
|
||||
|
||||
search_fields = ('name', 'authgroup__description')
|
||||
|
||||
def get_queryset(self, request):
|
||||
|
||||
@@ -79,5 +79,5 @@ class GroupManager:
|
||||
:return: True if the user can manage the group
|
||||
"""
|
||||
if user.is_authenticated:
|
||||
return cls.has_management_permission(user) or user.leads_groups.filter(group=group).exists()
|
||||
return cls.has_management_permission(user) or cls.get_group_leaders_groups(user).filter(pk=group.pk).exists()
|
||||
return False
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
from django.urls import reverse
|
||||
|
||||
|
||||
def get_admin_change_view_url(obj: object) -> str:
|
||||
return reverse(
|
||||
'admin:{}_{}_change'.format(
|
||||
obj._meta.app_label,
|
||||
type(obj).__name__.lower()
|
||||
),
|
||||
args=(obj.pk,)
|
||||
)
|
||||
@@ -1,22 +1,29 @@
|
||||
from unittest.mock import patch
|
||||
|
||||
from django.test import TestCase, RequestFactory
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.contrib.admin.sites import AdminSite
|
||||
from django.contrib.auth.models import User
|
||||
from django.test import TestCase, RequestFactory, Client
|
||||
|
||||
from allianceauth.authentication.models import CharacterOwnership, State
|
||||
from allianceauth.eveonline.autogroups.models import AutogroupsConfig
|
||||
from allianceauth.eveonline.models import (
|
||||
EveCharacter, EveCorporationInfo, EveAllianceInfo
|
||||
)
|
||||
|
||||
from ..admin import (
|
||||
IsAutoGroupFilter,
|
||||
from ..admin import (
|
||||
HasLeaderFilter,
|
||||
GroupAdmin,
|
||||
Group
|
||||
)
|
||||
from . import get_admin_change_view_url
|
||||
|
||||
if 'allianceauth.eveonline.autogroups' in settings.INSTALLED_APPS:
|
||||
_has_auto_groups = True
|
||||
from allianceauth.eveonline.autogroups.models import AutogroupsConfig
|
||||
from ..admin import IsAutoGroupFilter
|
||||
else:
|
||||
_has_auto_groups = False
|
||||
|
||||
|
||||
MODULE_PATH = 'allianceauth.groupmanagement.admin'
|
||||
@@ -210,14 +217,15 @@ class TestGroupAdmin(TestCase):
|
||||
|
||||
def _create_autogroups(self):
|
||||
"""create autogroups for corps and alliances"""
|
||||
autogroups_config = AutogroupsConfig(
|
||||
corp_groups = True,
|
||||
alliance_groups = True
|
||||
)
|
||||
autogroups_config.save()
|
||||
for state in State.objects.all():
|
||||
autogroups_config.states.add(state)
|
||||
autogroups_config.update_corp_group_membership(self.user_1)
|
||||
if _has_auto_groups:
|
||||
autogroups_config = AutogroupsConfig(
|
||||
corp_groups = True,
|
||||
alliance_groups = True
|
||||
)
|
||||
autogroups_config.save()
|
||||
for state in State.objects.all():
|
||||
autogroups_config.states.add(state)
|
||||
autogroups_config.update_corp_group_membership(self.user_1)
|
||||
|
||||
# column rendering
|
||||
|
||||
@@ -267,70 +275,72 @@ class TestGroupAdmin(TestCase):
|
||||
result = self.modeladmin._properties(self.group_6)
|
||||
self.assertListEqual(result, expected)
|
||||
|
||||
@patch(MODULE_PATH + '._has_auto_groups', True)
|
||||
def test_properties_6(self):
|
||||
self._create_autogroups()
|
||||
expected = ['Auto Group']
|
||||
my_group = Group.objects\
|
||||
.filter(managedcorpgroup__isnull=False)\
|
||||
.first()
|
||||
result = self.modeladmin._properties(my_group)
|
||||
self.assertListEqual(result, expected)
|
||||
if _has_auto_groups:
|
||||
@patch(MODULE_PATH + '._has_auto_groups', True)
|
||||
def test_properties_6(self):
|
||||
self._create_autogroups()
|
||||
expected = ['Auto Group']
|
||||
my_group = Group.objects\
|
||||
.filter(managedcorpgroup__isnull=False)\
|
||||
.first()
|
||||
result = self.modeladmin._properties(my_group)
|
||||
self.assertListEqual(result, expected)
|
||||
|
||||
# actions
|
||||
|
||||
# filters
|
||||
|
||||
@patch(MODULE_PATH + '._has_auto_groups', True)
|
||||
def test_filter_is_auto_group(self):
|
||||
|
||||
class GroupAdminTest(admin.ModelAdmin):
|
||||
list_filter = (IsAutoGroupFilter,)
|
||||
|
||||
self._create_autogroups()
|
||||
my_modeladmin = GroupAdminTest(Group, AdminSite())
|
||||
if _has_auto_groups:
|
||||
@patch(MODULE_PATH + '._has_auto_groups', True)
|
||||
def test_filter_is_auto_group(self):
|
||||
|
||||
class GroupAdminTest(admin.ModelAdmin):
|
||||
list_filter = (IsAutoGroupFilter,)
|
||||
|
||||
self._create_autogroups()
|
||||
my_modeladmin = GroupAdminTest(Group, AdminSite())
|
||||
|
||||
# Make sure the lookups are correct
|
||||
request = self.factory.get('/')
|
||||
request.user = self.user_1
|
||||
changelist = my_modeladmin.get_changelist_instance(request)
|
||||
filters = changelist.get_filters(request)
|
||||
filterspec = filters[0][0]
|
||||
expected = [
|
||||
('yes', 'Yes'),
|
||||
('no', 'No'),
|
||||
]
|
||||
self.assertEqual(filterspec.lookup_choices, expected)
|
||||
# Make sure the lookups are correct
|
||||
request = self.factory.get('/')
|
||||
request.user = self.user_1
|
||||
changelist = my_modeladmin.get_changelist_instance(request)
|
||||
filters = changelist.get_filters(request)
|
||||
filterspec = filters[0][0]
|
||||
expected = [
|
||||
('yes', 'Yes'),
|
||||
('no', 'No'),
|
||||
]
|
||||
self.assertEqual(filterspec.lookup_choices, expected)
|
||||
|
||||
# Make sure the correct queryset is returned - no
|
||||
request = self.factory.get(
|
||||
'/', {'is_auto_group__exact': 'no'}
|
||||
)
|
||||
request.user = self.user_1
|
||||
changelist = my_modeladmin.get_changelist_instance(request)
|
||||
queryset = changelist.get_queryset(request)
|
||||
expected = [
|
||||
self.group_1,
|
||||
self.group_2,
|
||||
self.group_3,
|
||||
self.group_4,
|
||||
self.group_5,
|
||||
self.group_6
|
||||
]
|
||||
self.assertSetEqual(set(queryset), set(expected))
|
||||
# Make sure the correct queryset is returned - no
|
||||
request = self.factory.get(
|
||||
'/', {'is_auto_group__exact': 'no'}
|
||||
)
|
||||
request.user = self.user_1
|
||||
changelist = my_modeladmin.get_changelist_instance(request)
|
||||
queryset = changelist.get_queryset(request)
|
||||
expected = [
|
||||
self.group_1,
|
||||
self.group_2,
|
||||
self.group_3,
|
||||
self.group_4,
|
||||
self.group_5,
|
||||
self.group_6
|
||||
]
|
||||
self.assertSetEqual(set(queryset), set(expected))
|
||||
|
||||
# Make sure the correct queryset is returned - yes
|
||||
request = self.factory.get(
|
||||
'/', {'is_auto_group__exact': 'yes'}
|
||||
)
|
||||
request.user = self.user_1
|
||||
changelist = my_modeladmin.get_changelist_instance(request)
|
||||
queryset = changelist.get_queryset(request)
|
||||
expected = Group.objects.exclude(
|
||||
managedalliancegroup__isnull=True,
|
||||
managedcorpgroup__isnull=True
|
||||
)
|
||||
self.assertSetEqual(set(queryset), set(expected))
|
||||
# Make sure the correct queryset is returned - yes
|
||||
request = self.factory.get(
|
||||
'/', {'is_auto_group__exact': 'yes'}
|
||||
)
|
||||
request.user = self.user_1
|
||||
changelist = my_modeladmin.get_changelist_instance(request)
|
||||
queryset = changelist.get_queryset(request)
|
||||
expected = Group.objects.exclude(
|
||||
managedalliancegroup__isnull=True,
|
||||
managedcorpgroup__isnull=True
|
||||
)
|
||||
self.assertSetEqual(set(queryset), set(expected))
|
||||
|
||||
def test_filter_has_leader(self):
|
||||
|
||||
@@ -376,4 +386,12 @@ class TestGroupAdmin(TestCase):
|
||||
self.group_3
|
||||
]
|
||||
self.assertSetEqual(set(queryset), set(expected))
|
||||
|
||||
|
||||
def test_change_view_loads_normally(self):
|
||||
User.objects.create_superuser(
|
||||
username='superuser', password='secret', email='admin@example.com'
|
||||
)
|
||||
c = Client()
|
||||
c.login(username='superuser', password='secret')
|
||||
response = c.get(get_admin_change_view_url(self.group_1))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
@@ -26,9 +26,7 @@ class GroupManagementVisibilityTestCase(TestCase):
|
||||
self.user = User.objects.get(pk=self.user.pk)
|
||||
|
||||
|
||||
def test_can_manage_group(self):
|
||||
|
||||
|
||||
def test_get_group_leaders_groups(self):
|
||||
self.group1.authgroup.group_leaders.add(self.user)
|
||||
self.group2.authgroup.group_leader_groups.add(self.group1)
|
||||
self._refresh_user()
|
||||
@@ -46,6 +44,24 @@ class GroupManagementVisibilityTestCase(TestCase):
|
||||
self.assertIn(self.group2, groups) #avail due to group1
|
||||
self.assertNotIn(self.group3, groups) #not avail at all
|
||||
|
||||
def test_can_manage_group(self):
|
||||
self.group1.authgroup.group_leaders.add(self.user)
|
||||
self.user.groups.add(self.group1)
|
||||
self._refresh_user()
|
||||
|
||||
self.assertTrue(GroupManager.can_manage_group(self.user, self.group1))
|
||||
self.assertFalse(GroupManager.can_manage_group(self.user, self.group2))
|
||||
self.assertFalse(GroupManager.can_manage_group(self.user, self.group3))
|
||||
|
||||
self.group2.authgroup.group_leader_groups.add(self.group1)
|
||||
self.group1.authgroup.group_leaders.remove(self.user)
|
||||
self._refresh_user()
|
||||
|
||||
self.assertFalse(GroupManager.can_manage_group(self.user, self.group1))
|
||||
self.assertTrue(GroupManager.can_manage_group(self.user, self.group2))
|
||||
self.assertFalse(GroupManager.can_manage_group(self.user, self.group3))
|
||||
|
||||
|
||||
class GroupManagementStateTestCase(TestCase):
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
@@ -72,7 +88,6 @@ class GroupManagementStateTestCase(TestCase):
|
||||
self.state_group = Group.objects.get(pk=self.state_group.pk)
|
||||
|
||||
def test_drop_state_group(self):
|
||||
|
||||
self.user.groups.add(self.open_group)
|
||||
self.user.groups.add(self.state_group)
|
||||
self.assertEqual(self.user.profile.state.name, "Guest")
|
||||
|
||||
@@ -33,7 +33,8 @@ def group_management(request):
|
||||
group_requests = base_group_query.all()
|
||||
else:
|
||||
# Group specific leader
|
||||
group_requests = base_group_query.filter(group__authgroup__group_leaders__in=[request.user])
|
||||
users__groups = GroupManager.get_group_leaders_groups(request.user)
|
||||
group_requests = base_group_query.filter(group__in=users__groups)
|
||||
|
||||
for grouprequest in group_requests:
|
||||
if grouprequest.leave_request:
|
||||
|
||||
BIN
allianceauth/locale/en/LC_MESSAGES/django.mo
Normal file
1805
allianceauth/locale/en/LC_MESSAGES/django.po
Normal file
BIN
allianceauth/locale/zh_Hans/LC_MESSAGES/django.mo
Normal file
1807
allianceauth/locale/zh_Hans/LC_MESSAGES/django.po
Normal file
@@ -83,6 +83,7 @@ LANGUAGES = (
|
||||
('en', ugettext('English')),
|
||||
('de', ugettext('German')),
|
||||
('es', ugettext('Spanish')),
|
||||
('zh-hans', ugettext('Chinese Simplified')),
|
||||
)
|
||||
|
||||
TEMPLATES = [
|
||||
|
||||
@@ -20,11 +20,8 @@ class ServicesUserAdmin(admin.ModelAdmin):
|
||||
"all": ("services/admin.css",)
|
||||
}
|
||||
|
||||
search_fields = (
|
||||
'user__username',
|
||||
'uid'
|
||||
)
|
||||
ordering = ('user__username', )
|
||||
search_fields = ('user__username',)
|
||||
ordering = ('user__username',)
|
||||
list_select_related = True
|
||||
list_display = (
|
||||
user_profile_pic,
|
||||
|
||||
@@ -6,9 +6,8 @@ from ...admin import ServicesUserAdmin
|
||||
|
||||
@admin.register(DiscordUser)
|
||||
class DiscordUserAdmin(ServicesUserAdmin):
|
||||
list_display = ServicesUserAdmin.list_display + (
|
||||
'_uid',
|
||||
)
|
||||
list_display = ServicesUserAdmin.list_display + ('_uid',)
|
||||
search_fields = ServicesUserAdmin.search_fields + ('uid', )
|
||||
|
||||
def _uid(self, obj):
|
||||
return obj.uid
|
||||
|
||||
@@ -10,6 +10,7 @@ class Teamspeak3UserAdmin(ServicesUserAdmin):
|
||||
'uid',
|
||||
'perm_key'
|
||||
)
|
||||
search_fields = ServicesUserAdmin.search_fields + ('uid', )
|
||||
|
||||
|
||||
@admin.register(AuthTS)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
{% load i18n %}
|
||||
|
||||
|
||||
|
||||
{% block page_title %}
|
||||
{% blocktrans with service_name=view.service_name|title %}Delete {{ service_name }} Account?{% endblocktrans %}
|
||||
{% endblock page_title %}
|
||||
@@ -18,8 +17,8 @@
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
<p>
|
||||
{% blocktrans trimmed %}
|
||||
Are you sure you want to delete your {{ view.service_name }} account {{ object }}?
|
||||
{% blocktrans trimmed with service_name=view.service_name|title %}
|
||||
Are you sure you want to delete your {{ service_name }} account {{ object }}?
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
<input class="btn btn-danger btn-block" type="submit" value="Confirm" />
|
||||
|
||||
@@ -90,10 +90,9 @@
|
||||
<th class="text-center">{% trans "Ship Type" %}</th>
|
||||
<th class="text-center">{% trans "Killboard Loss Amt" %}</th>
|
||||
<th class="text-center">{% trans "SRP ISK Cost" %}
|
||||
{% blocktrans %}<i class="glyphicon glyphicon-question-sign" rel="tooltip" title="Click value to edit
|
||||
Enter to save&next
|
||||
ESC to cancel"
|
||||
id="blah"></i></th>{% endblocktrans %}
|
||||
<i class="glyphicon glyphicon-question-sign" rel="tooltip" title="{% blocktrans trimmed %}Click value to edit
|
||||
Enter to save & next
|
||||
ESC to cancel{% endblocktrans %}"id="blah"></i></th>
|
||||
<th class="text-center">{% trans "Post Time" %}</th>
|
||||
<th class="text-center">{% trans "Status" %}</th>
|
||||
{% if perms.auth.srp_management %}
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
{% if task_queue_length < 0 %}
|
||||
{% trans "Error retrieving task queue length" %}
|
||||
{% else %}
|
||||
{% blocktrans count tasks=task_queue_length %}
|
||||
{% blocktrans trimmed count tasks=task_queue_length %}
|
||||
{{ tasks }} task
|
||||
{% plural %}
|
||||
{{ tasks }} tasks
|
||||
|
||||
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 258 KiB After Width: | Height: | Size: 258 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 903 B After Width: | Height: | Size: 903 B |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
BIN
docs/_static/images/features/apps/fat.png
vendored
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
docs/_static/images/features/apps/hr.png
vendored
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
docs/_static/images/features/apps/optimer.png
vendored
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
docs/_static/images/features/apps/permissions_tool/audit.png
vendored
Normal file
|
After Width: | Height: | Size: 99 KiB |
4
docs/_static/images/features/apps/permissions_tool/audit.png:Zone.Identifier
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
||||
ReferrerUrl=https://i.imgur.com/6dXZ5BH.png
|
||||
HostUrl=https://i.imgur.com/6dXZ5BH.png
|
||||
BIN
docs/_static/images/features/apps/permissions_tool/overview.png
vendored
Normal file
|
After Width: | Height: | Size: 63 KiB |
4
docs/_static/images/features/apps/permissions_tool/overview.png:Zone.Identifier
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
[ZoneTransfer]
|
||||
ZoneId=3
|
||||
ReferrerUrl=https://i.imgur.com/Er1g02v.png
|
||||
HostUrl=https://i.imgur.com/Er1g02v.png
|
||||
BIN
docs/_static/images/features/apps/srp.png
vendored
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
docs/_static/images/features/apps/timerboard.png
vendored
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
docs/_static/images/features/core/dashboard/dashboard.png
vendored
Normal file
|
After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 56 KiB |
@@ -54,7 +54,7 @@ master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'Alliance Auth'
|
||||
copyright = u'2018, Alliance Auth'
|
||||
copyright = u'2018-2020, Alliance Auth'
|
||||
author = u'R4stl1n'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Documentation
|
||||
# Alliance Auth documentation
|
||||
|
||||
The documentation for Alliance Auth uses [Sphinx](http://www.sphinx-doc.org/) to build documentation. When a new commit
|
||||
to specific branches is made (master, primarily), the repository is automatically pulled, docs built and deployed on
|
||||
10
docs/development/aa_core/index.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# Developing AA Core
|
||||
|
||||
This section contains important information on how to develop Alliance Auth itself.
|
||||
|
||||
```eval_rst
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
documentation
|
||||
```
|
||||
12
docs/development/custom/index.md
Normal file
@@ -0,0 +1,12 @@
|
||||
# Custom apps and services
|
||||
|
||||
This section describes how to extend **Alliance Auth** with custom apps and services.
|
||||
|
||||
```eval_rst
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
integrating-services
|
||||
menu-hooks
|
||||
url-hooks
|
||||
```
|
||||
@@ -1,10 +1,11 @@
|
||||
# Development
|
||||
|
||||
**Alliance Auth** is designed to be extended easily. Learn how to develop your own apps and services for AA or to develop for AA core in the development chapter.
|
||||
|
||||
```eval_rst
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
documentation
|
||||
integrating-services
|
||||
menu-hooks
|
||||
url-hooks
|
||||
custom/index
|
||||
aa_core/index
|
||||
```
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
|
||||
Auto groups allows you to automatically place users of certain states into Corp or Alliance based groups. These groups are created when the first user is added to them and removed when the configuration is deleted.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Add `'allianceauth.eveonline.autogroups',` to your `INSTALLED_APPS` list and run migrations. All other settings are controlled via the admin panel under the `Eve_Autogroups` section.
|
||||
This is an optional app that needs to be installed.
|
||||
|
||||
To install this app add `'allianceauth.eveonline.autogroups',` to your `INSTALLED_APPS` list and run migrations. All other settings are controlled via the admin panel under the `Eve_Autogroups` section.
|
||||
|
||||
## Configuring a group
|
||||
|
||||
When you create an autogroup config you will be given the following options:
|
||||
|
||||

|
||||

|
||||
|
||||
```eval_rst
|
||||
.. warning::
|
||||
@@ -28,7 +28,7 @@ When you create an autogroup config you will be given the following options:
|
||||
|
||||
- Corp/Alliance groups checkbox toggles Corp/Alliance autogroups on or off for this config.
|
||||
|
||||
- Corp/Alliance group prefix sets the prefix for the group name, e.g. if your Corp was called `MyCorp` and your prefix was `Corp `, your autogroup name would be created as `Corp MyCorp`. This field accepts leading/trailing spaces.
|
||||
- Corp/Alliance group prefix sets the prefix for the group name, e.g. if your Corp was called `MyCorp` and your prefix was `Corp`, your autogroup name would be created as `Corp MyCorp`. This field accepts leading/trailing spaces.
|
||||
|
||||
- Corp/Alliance name source sets the source of the Corp/Alliance name used in creating the group name. Currently the options are Full name and Ticker.
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
# Corp Stats
|
||||
# Corporation Stats
|
||||
|
||||
This module is used to check the registration status of Corp members and to determine character relationships, being mains or alts.
|
||||
|
||||

|
||||
|
||||
## Installation
|
||||
|
||||
Corp Stats requires access to the `esi-corporations.read_corporation_membership.v1` SSO scope. Update your application on the [EVE Developers site](https://developers.eveonline.com) to ensure it is available.
|
||||
@@ -12,17 +14,17 @@ Add `'allianceauth.corputils',` to your `INSTALLED_APPS` list in your auth proje
|
||||
|
||||
Upon initial install, nothing will be visible. For every Corp, a model will have to be created before data can be viewed.
|
||||
|
||||

|
||||

|
||||
|
||||
If you are a superuser, the add button will be immediate visible to you. If not, your user account requires the `add_corpstats` permission.
|
||||
|
||||
Corp Stats requires an EVE SSO token to access data from the EVE Swagger Interface. Upon pressing the Add button, you will be prompted to authenticated. Please select the character who is in the Corporation you want data for.
|
||||
|
||||

|
||||

|
||||
|
||||
You will return to auth where you are asked to select a token with the green arrow button. If you want to use a different character, press the `LOG IN with EVE Online` button.
|
||||
|
||||

|
||||

|
||||
|
||||
If this works (and you have permission to view the Corp Stats you just created) you'll be returned to a view of the Corp Stats.
|
||||
If it fails an error message will be displayed.
|
||||
@@ -31,7 +33,7 @@ If it fails an error message will be displayed.
|
||||
|
||||
### Navigation Bar
|
||||
|
||||

|
||||

|
||||
|
||||
This bar contains a dropdown menu of all available Corporations. If the user has the `add_corpstats` permission, a button to add a Corp Stats will be shown.
|
||||
|
||||
@@ -39,52 +41,51 @@ On the right of this bar is a search field. Press enter to search. It checks all
|
||||
|
||||
### Last Update
|
||||
|
||||

|
||||

|
||||
|
||||
An update can be performed immediately by pressing the update button. Anyone who can view the Corp Stats can update it.
|
||||
|
||||
### Character Lists
|
||||
|
||||

|
||||

|
||||
|
||||
Three views are available:
|
||||
- main characters and their alts
|
||||
- registered characters and their main character
|
||||
- unregistered characters
|
||||
|
||||
- main characters and their alts
|
||||
- registered characters and their main character
|
||||
- unregistered characters
|
||||
|
||||
Each view contains a sortable and searchable table. The number of listings shown can be increased with a dropdown selector. Pages can be changed using the controls on the bottom-right of the table. Each list is searchable at the top-right. Tables can be re-ordered by clicking on column headings.
|
||||
|
||||

|
||||

|
||||
|
||||
#### Main List
|
||||
|
||||

|
||||

|
||||
|
||||
This list contains all main characters in registered in the selected Corporation and their alts. Each character has a link to [zKillboard](https://zkillboard.com).
|
||||
|
||||
|
||||
#### Member List
|
||||
|
||||

|
||||

|
||||
|
||||
The list contains all characters in the Corporation. Red backgrounds means they are not registered in auth. A link to [zKillboard](https://zkillboard.com) is present for all characters.
|
||||
If registered, the character will also have a main character, main Corporation, and main Alliance field.
|
||||
|
||||
#### Unregistered List
|
||||
|
||||

|
||||

|
||||
|
||||
This list contains all characters not registered on auth. Each character has a link to [zKillboard](https://zkillboard.com).
|
||||
|
||||
## Search View
|
||||
|
||||

|
||||

|
||||
|
||||
This view is essentially the same as the Corp Stats page, but not specific to a single Corporation.
|
||||
The search query is visible in the search box.
|
||||
Characters from all Corp Stats to which the user has view access will be displayed. APIs respect permissions.
|
||||
|
||||
|
||||
## Permissions
|
||||
|
||||
To use this feature, users will require some of the following:
|
||||
@@ -108,15 +109,18 @@ To use this feature, users will require some of the following:
|
||||
|
||||
```
|
||||
|
||||
Users who add a Corp Stats with their token will be granted permissions to view it regardless of the above permissions. View permissions are interpreted in the "OR" sense: a user can view their Corporations's Corp Stats without the `view_corp_corpstats` permission if they have the `view_alliance_corpstats` permission, same idea for their state. Note that these evaluate against the user's main character.
|
||||
Users who add a Corp Stats with their token will be granted permissions to view it regardless of the above permissions. View permissions are interpreted in the "OR" sense: a user can view their corporation's Corp Stats without the `view_corp_corpstats` permission if they have the `view_alliance_corpstats` permission, same idea for their state. Note that these evaluate against the user's main character.
|
||||
|
||||
## Automatic Updating
|
||||
|
||||
By default Corp Stats are only updated on demand. If you want to automatically refresh on a schedule, add an entry to your project's settings file:
|
||||
|
||||
CELERYBEAT_SCHEDULE['update_all_corpstats'] = {
|
||||
'task': 'allianceauth.corputils.tasks.update_all_corpstats',
|
||||
'schedule': crontab(minute=0, hour="*/6"),
|
||||
}
|
||||
```python
|
||||
CELERYBEAT_SCHEDULE['update_all_corpstats'] = {
|
||||
'task': 'allianceauth.corputils.tasks.update_all_corpstats',
|
||||
'schedule': crontab(minute=0, hour="*/6"),
|
||||
}
|
||||
```
|
||||
|
||||
Adjust the crontab as desired.
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
# Fleet Activity Tracking
|
||||
|
||||
The Fleet Activity Tracking (FAT) app allows you to track fleet participation.
|
||||
|
||||

|
||||
|
||||
## Installation
|
||||
|
||||
Fleet Activity Tracking requires access to the `esi-location.read_location.v1`, `esi-location.read_ship_type.v1`, and `esi-universe.read_structures.v1` SSO scopes. Update your application on the [EVE Developers site](https://developers.eveonline.com) to ensure these are available.
|
||||
|
||||
Add `'allianceauth.fleetactivitytracking',` to your `INSTALLED_APPS` list in your auth project's settings file. Run migrations to complete installation.
|
||||
Add `'allianceauth.fleetactivitytracking',` to your `INSTALLED_APPS` list in your auth project's settings file. Run migrations to complete installation.
|
||||
@@ -1,5 +1,13 @@
|
||||
# HR Applications
|
||||
|
||||
This app allows you to manage applications for multiple corporations in your alliance. Key features include:
|
||||
|
||||
- Define application questionnaires for corporations
|
||||
- Users can apply to corporations by filling outquestionnaires
|
||||
- Manage review and approval process of applications
|
||||
|
||||

|
||||
|
||||
## Installation
|
||||
|
||||
Add `'allianceauth.hrapplications',` to your `INSTALLED_APPS` list in your auth project's settings file. Run migrations to complete installation.
|
||||
17
docs/features/apps/index.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Apps
|
||||
|
||||
**Alliance Auth** comes with a set of apps (also called plugin-apps) which provide basic functions useful to many organizations in Eve Online like a fleet schedule and a timerboard. This section describes which apps are available and how to install and use them. Please note that any app need to be installed before it can be used.
|
||||
|
||||
```eval_rst
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
autogroups
|
||||
corpstats
|
||||
fleetactivitytracking
|
||||
hrapplications
|
||||
optimer
|
||||
permissions_tool
|
||||
srp
|
||||
timerboard
|
||||
```
|
||||
9
docs/features/apps/optimer.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Fleet Operations
|
||||
|
||||
Fleet Operations is an app for organizing and communicating fleet schedules.
|
||||
|
||||

|
||||
|
||||
## Installation
|
||||
|
||||
Add `'allianceauth.optimer',` to your `INSTALLED_APPS` list in your auth project's settings file. Run migrations to complete installation.
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
Access to most of Alliance Auth's features are controlled by Django's permissions system. In order to help you secure your services, Alliance Auth provides a permissions auditing tool.
|
||||
|
||||
## Installation
|
||||
This is an optional app that needs to be installed.
|
||||
|
||||
Add `'allianceauth.permissions_tool',` to your `INSTALLED_APPS` list in your auth project's settings file.
|
||||
To install it add `'allianceauth.permissions_tool',` to your `INSTALLED_APPS` list in your auth project's settings file.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -14,12 +14,11 @@ In order to grant users access to the permissions auditing tool they will need t
|
||||
|
||||
When a user has access to the tool they will see the "Permissions Audit" menu item under the "Util" sub menu.
|
||||
|
||||
|
||||
### Permissions Overview
|
||||
|
||||
The first page gives you a general overview of permissions and how many users have access to each permission.
|
||||
|
||||

|
||||

|
||||
|
||||
**App**, **Model** and **Code Name** contain the internal details of the permission while **Name** contains the name/description you'll see in the admin panel.
|
||||
|
||||
@@ -35,6 +34,6 @@ Clicking on the **Code Name** link will take you to the [Permissions Audit Page]
|
||||
|
||||
The permissions audit page will give you an overview of all the users who have access to this permission either directly or granted via group membership.
|
||||
|
||||

|
||||

|
||||
|
||||
Please note that users may appear multiple times if this permission is granted via multiple sources.
|
||||
9
docs/features/apps/srp.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Ship Replacement
|
||||
|
||||
Ship Replacement helps you to organize ship replacement programs (SRP) for your alliance.
|
||||
|
||||

|
||||
|
||||
## Installation
|
||||
|
||||
Add `'allianceauth.srp',` to your `INSTALLED_APPS` list in your auth project's settings file. Run migrations to complete installation.
|
||||
9
docs/features/apps/timerboard.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Structure Timers
|
||||
|
||||
Structure Timers helps you keep track of both offensive and defensive structure timers in your space.
|
||||
|
||||

|
||||
|
||||
## Installation
|
||||
|
||||
Add `'allianceauth.timerboard',` to your `INSTALLED_APPS` list in your auth project's settings file. Run migrations to complete installation.
|
||||
7
docs/features/community/index.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Community Contributions
|
||||
|
||||
Another key feature of **Alliance Auth** is that it can be easily extended. Our great community is providing a variety of plug-in apps and services, which you can choose from to add more functions to your AA installation.
|
||||
|
||||
Check out the [Community Creations](https://gitlab.com/allianceauth/community-creations) repo for more details.
|
||||
|
||||
Or if you have very specific needs you can of course develop your own plugin- apps and services. Please see the [Development](/development/index.md) chapter details.
|
||||
9
docs/features/core/dashboard.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Dashboard
|
||||
|
||||
The dashboard is the main page of the **Alliance Auth** website and the first page every logged in user will see.
|
||||
|
||||
The content of the dashboard is specific to the logged in user. It has a sidebar, which will display the list of apps a user currently as access to based on his permissions. And it also shows which character the user has registered and to which group he belongs.
|
||||
|
||||
For admin users the dashboard shows additional technical information about the AA instance.
|
||||
|
||||

|
||||
41
docs/features/core/groupmanagement.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Group Management
|
||||
|
||||
In order to access group management, users need to be either a superuser, granted the `auth | user | group_management ( Access to add members to groups within the alliance )` permission or a group leader (discussed later).
|
||||
|
||||
## Group Requests
|
||||
|
||||
When a user joins or leaves a group which is not marked as "Open", their group request will have to be approved manually by a user with the `group_management` permission or by a group leader of the group they are requesting.
|
||||
|
||||
## Group Membership
|
||||
|
||||
The group membership tab gives an overview of all of the non-internal groups.
|
||||
|
||||

|
||||
|
||||
### Group Member Management
|
||||
|
||||
Clicking on the blue eye will take you to the group member management screen. Here you can see a list of people who are in the group, and remove members where necessary.
|
||||
|
||||

|
||||
|
||||
### 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 have the same abilities as users with the `group_management` permission, _however_, they will only be able to:
|
||||
|
||||
- Approve requests for groups they are a leader of.
|
||||
- View the Group Membership and Group Members of groups they are leaders of.
|
||||
|
||||
This allows you to more finely control who has access to manage which groups. Currently it is not possible to add a Group as group leaders.
|
||||
@@ -1,42 +1,45 @@
|
||||
# Groups
|
||||
|
||||
Group Management is one of the core tasks of Alliance Auth. Many of Alliance Auth's services allow for synchronising of group membership, allowing you to grant permissions or roles in services to access certain aspects of them.
|
||||
|
||||
## User Organised Groups
|
||||
## User Organized Groups
|
||||
|
||||
Administrators can create custom groups for users to join. Examples might be groups like `Leadership`, `CEO` or `Scouts`.
|
||||
|
||||
When you create a `Group` additional settings are available beyond the normal Django group model. The admin page looks like this:
|
||||
|
||||

|
||||

|
||||
|
||||
Here you have several options:
|
||||
|
||||
#### Internal
|
||||
### Internal
|
||||
|
||||
Users cannot see, join or request to join this group. This is primarily used for Auth's internally managed groups, though can be useful if you want to prevent users from managing their membership of this group themselves. This option will override the Hidden, Open and Public options when enabled.
|
||||
|
||||
By default, every new group created will be an internal group.
|
||||
|
||||
#### Hidden
|
||||
### Hidden
|
||||
|
||||
Group is hidden from the user interface, but users can still join if you give them the appropriate join link. The URL will be along the lines of `https://example.com/en/group/request_add/{group_id}`. You can get the Group ID from the admin page URL.
|
||||
|
||||
This option still respects the Open option.
|
||||
|
||||
|
||||
### Open
|
||||
|
||||
When a group is toggled open, users who request to join the group will be immediately added to the group.
|
||||
|
||||
If the group is not open, their request will have to be approved manually by someone with the group management role, or a group leader of that group.
|
||||
|
||||
|
||||
### Public
|
||||
|
||||
Group is accessible to any registered user, even when they do not have permission to join regular groups.
|
||||
|
||||
The key difference is that the group is completely unmanaged by Auth. **Once a member joins they will not be removed unless they leave manually, you remove them manually, or their account is deliberately set inactive or deleted.**
|
||||
|
||||
Most people won't have a use for public groups, though it can be useful if you wish to allow public access to some services. You can grant service permissions on a public group to allow this behaviour.
|
||||
|
||||
Most people won't have a use for public groups, though it can be useful if you wish to allow public access to some services. You can grant service permissions on a public group to allow this behavior.
|
||||
|
||||
## Permission
|
||||
|
||||
In order to join a group other than a public group, the permission `groupmanagement.request_groups` (`Can request non-public groups` in the admin panel) must be active on their account, either via a group or directly applied to their User account.
|
||||
|
||||
When a user loses this permission, they will be removed from all groups _except_ Public groups.
|
||||
@@ -45,44 +48,3 @@ When a user loses this permission, they will be removed from all groups _except_
|
||||
.. note::
|
||||
By default, the ``groupmanagement.request_groups`` permission is applied to the ``Member`` group. In most instances this, and perhaps adding it to the ``Blue`` group, should be all that is ever needed. It is unsupported and NOT advisable to apply this permission to a public group. See #697 for more information.
|
||||
```
|
||||
|
||||
# Group Management
|
||||
|
||||
In order to access group management, users need to be either a superuser, granted the `auth | user | group_management ( Access to add members to groups within the alliance )` permission or a group leader (discussed later).
|
||||
|
||||
## Group Requests
|
||||
|
||||
When a user joins or leaves a group which is not marked as "Open", their group request will have to be approved manually by a user with the `group_management` permission or by a group leader of the group they are requesting.
|
||||
|
||||
## Group Membership
|
||||
|
||||
The group membership tab gives an overview of all of the non-internal groups.
|
||||
|
||||

|
||||
|
||||
### Group Member Management
|
||||
|
||||
Clicking on the blue eye will take you to the group member management screen. Here you can see a list of people who are in the group, and remove members where necessary.
|
||||
|
||||

|
||||
|
||||
### 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 have the same abilities as users with the `group_management` permission, _however_, they will only be able to:
|
||||
|
||||
- Approve requests for groups they are a leader of.
|
||||
- View the Group Membership and Group Members of groups they are leaders of.
|
||||
|
||||
This allows you to more finely control who has access to manage which groups. Currently it is not possible to add a Group as group leaders.
|
||||
13
docs/features/core/index.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# Core Features
|
||||
|
||||
Managing access to applications and services is one of the core functions of **Alliance Auth**. The related key concepts and functionalities are describes in this section.
|
||||
|
||||
```eval_rst
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
dashboard
|
||||
states
|
||||
groups
|
||||
groupmanagement
|
||||
```
|
||||
@@ -1,38 +1,49 @@
|
||||
# The State System
|
||||
# States
|
||||
|
||||
## Overview
|
||||
States define the basic role of a user based on his affiliation with your organization. A user that has a character in your organization (e.g. alliance) will usually have the `Member` state. And a user, that has no characters in your organization will usually have the `Guest` state.
|
||||
|
||||
In Alliance Auth v1 admins were able to define which Corporations and Alliances were to be considered "members" with full permissions and "blues" with restricted permissions. The state system is the replacement for these static definitions: admins can now create as many states as desired, as well as extend membership to specific characters.
|
||||
States are assigned and updated automatically. So a user which character just left your organization will automatically loose his `Member` state and get the `Guest` state instead.
|
||||
|
||||
The main purpose of states like `Member` is to have one place where you can assign all permissions that should apply to all users with that particular state. For example if all your members should have access to the SRP app you would add the permission that gives access to the SRP app to the `Member` state.
|
||||
|
||||
## Creating a State
|
||||
|
||||
States are created through your installation's admin site. Upon install three states are created for you: `Member`, `Blue`, and `Guest`. New ones can be created like any other Django model by users with the appropriate permission (`authentication | state | Can add state`) or superusers.
|
||||
|
||||
A number of fields are available and are described below.
|
||||
|
||||
### Name
|
||||
|
||||
This is the displayed name of a state. Should be self-explanatory.
|
||||
|
||||
### Permissions
|
||||
|
||||
This lets you select permissions to grant to the entire state, much like a group. Any user with this state will be granted these permissions.
|
||||
|
||||
A common use case would be granting service access to a state.
|
||||
|
||||
### Priority
|
||||
|
||||
This value determines the order in which states are applied to users. Higher numbers come first. So if a random user `Bob` could member of both the `Member` and `Blue` states, because `Member` has a higher priority `Bob` will be assigned to it.
|
||||
|
||||
### Public
|
||||
|
||||
Checking this box means this state is available to all users. There isn't much use for this outside the `Guest` state.
|
||||
|
||||
### Member Characters
|
||||
|
||||
This lets you select which characters the state is available to. Characters can be added by selecting the green plus icon.
|
||||
|
||||
### Member Corporations
|
||||
|
||||
This lets you select which Corporations the state is available to. Corporations can be added by selecting the green plus icon.
|
||||
|
||||
### Member Alliances
|
||||
|
||||
This lets you select which Alliances the state is available to. Alliances can be added by selecting the green plus icon.
|
||||
|
||||
## Determining a User's State
|
||||
|
||||
States are mutually exclusive, meaning a user can only be in one at a time.
|
||||
|
||||
Membership is determined based on a user's main character. States are tested in order of descending priority - the first one which allows membership to the main character is assigned to the user.
|
||||
@@ -42,6 +53,7 @@ States are automatically assigned when a user registers to the site, their main
|
||||
Assigned states are visible in the `Users` section of the `Authentication` admin site.
|
||||
|
||||
## The Guest State
|
||||
|
||||
If no states are available to a user's main character, or their account has been deactivated, they are assigned to a catch-all `Guest` state. This state cannot be deleted nor can its name be changed.
|
||||
|
||||
The `Guest` state allows permissions to be granted to users who would otherwise not get any. For example access to public services can be granted by giving the `Guest` state a service access permission.
|
||||
@@ -1,20 +1,14 @@
|
||||
# Features
|
||||
|
||||
Learn about the features of **Alliance Auth** and how to install and use them.
|
||||
|
||||
```eval_rst
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Features Contents
|
||||
|
||||
states
|
||||
groups
|
||||
autogroups
|
||||
hrapplications
|
||||
corpstats
|
||||
permissions_tool
|
||||
nameformats
|
||||
fleetup
|
||||
fleetactivitytracking
|
||||
optimer
|
||||
srp
|
||||
timerboard
|
||||
overview
|
||||
core/index
|
||||
services/index
|
||||
apps/index
|
||||
community/index
|
||||
```
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
# Optimer
|
||||
|
||||
## Installation
|
||||
|
||||
Add `'allianceauth.optimer',` to your `INSTALLED_APPS` list in your auth project's settings file. Run migrations to complete installation.
|
||||
19
docs/features/overview.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Overview
|
||||
|
||||
**Alliance Auth** (AA) is a web application that helps Eve Online organizations efficiently manage access to external services and web apps.
|
||||
|
||||
It has the following key features:
|
||||
|
||||
- Automatically grants or revokes users access to external services (e.g. Discord, Mumble) and web apps (e.g. SRP requests) based on the user's current membership to [in-game organizations](/features/core/states) and [groups](/features/core/groups)
|
||||
|
||||
- Provides a central web site where users can directly access web apps (e.g. SRP requests) and manage their access to external services and groups.
|
||||
|
||||
- Includes a set of connectors (called ["services"](/features/services/index)) for integrating access management with many popular external services like Discord, Mumble, Teamspeak 3, SMF and others
|
||||
|
||||
- Includes a set of web [apps](/features/apps/index) which add many useful functions, e.g.: fleet schedule, timer board, SRP request management, fleet activity tracker
|
||||
|
||||
- Can be easily extended with additional services and apps. Many are provided by the [community](/features/community/index).
|
||||
|
||||
Here is an example how the main page of the web site looks:
|
||||
|
||||

|
||||
@@ -1,5 +1,7 @@
|
||||
# Discord
|
||||
|
||||
## Overview
|
||||
|
||||
Discord is a web-based instant messaging client with voice. Kind of like TeamSpeak meets Slack meets Skype. It also has a standalone app for phones and desktop.
|
||||
|
||||
Discord is very popular amongst ad-hoc small groups and larger organizations seeking a modern technology. Alternative voice communications should be investigated for larger than small-medium groups for more advanced features.
|
||||
@@ -12,11 +14,13 @@ Discord is very popular amongst ad-hoc small groups and larger organizations see
|
||||
```
|
||||
|
||||
### Prepare Your Settings File
|
||||
|
||||
In your auth project's settings file, do the following:
|
||||
- Add `'allianceauth.services.modules.discord',` to your `INSTALLED_APPS` list
|
||||
- Append the following to the bottom of the settings file:
|
||||
|
||||
- Add `'allianceauth.services.modules.discord',` to your `INSTALLED_APPS` list
|
||||
- Append the following to the bottom of the settings file:
|
||||
|
||||
```python
|
||||
# Discord Configuration
|
||||
DISCORD_GUILD_ID = ''
|
||||
DISCORD_CALLBACK_URL = ''
|
||||
@@ -24,8 +28,10 @@ In your auth project's settings file, do the following:
|
||||
DISCORD_APP_SECRET = ''
|
||||
DISCORD_BOT_TOKEN = ''
|
||||
DISCORD_SYNC_NAMES = False
|
||||
```
|
||||
|
||||
### Creating a Server
|
||||
|
||||
Navigate to the [Discord site](https://discordapp.com/) and register an account, or log in if you have one already.
|
||||
|
||||
On the left side of the screen you’ll see a circle with a plus sign. This is the button to create a new server. Go ahead and do that, naming it something obvious.
|
||||
@@ -50,14 +56,17 @@ Update your auth project's settings file, inputting this redirect address as `DI
|
||||
On the application summary page, press Create a Bot User.
|
||||
|
||||
Update your auth project's settings file with these pieces of information from the summary page:
|
||||
- From the App Details panel, `DISCORD_APP_ID` is the Client/Application ID
|
||||
- From the App Details panel, `DISCORD_APP_SECRET` is the Secret
|
||||
- From the App Bot Users panel, `DISCORD_BOT_TOKEN` is the Token
|
||||
|
||||
- From the App Details panel, `DISCORD_APP_ID` is the Client/Application ID
|
||||
- From the App Details panel, `DISCORD_APP_SECRET` is the Secret
|
||||
- From the App Bot Users panel, `DISCORD_BOT_TOKEN` is the Token
|
||||
|
||||
### Preparing Auth
|
||||
|
||||
Before continuing it is essential to run migrations and restart Gunicorn and Celery.
|
||||
|
||||
### Adding a Bot to the Server
|
||||
|
||||
Once created, navigate to the services page of your Alliance Auth install as the superuser account. At the top there is a big green button labelled Link Discord Server. Click it, then from the drop down select the server you created, and then Authorize.
|
||||
|
||||
This adds a new user to your Discord server with a `BOT` tag, and a new role with the same name as your Discord application. Don't touch either of these. If for some reason the bot loses permissions or is removed from the server, click this button again.
|
||||
@@ -67,15 +76,19 @@ To manage roles, this bot role must be at the top of the hierarchy. Edit your Di
|
||||
Note that the bot will never appear online as it does not participate in chat channels.
|
||||
|
||||
### Linking Accounts
|
||||
|
||||
Instead of the usual account creation procedure, for Discord to work we need to link accounts to Alliance Auth. When attempting to enable the Discord service, users are redirected to the official Discord site to authenticate. They will need to create an account if they don't have one prior to continuing. Upon authorization, users are redirected back to Alliance Auth with an OAuth code which is used to join the Discord server.
|
||||
|
||||
### Syncing Nicknames
|
||||
|
||||
If you want users to have their Discord nickname changed to their in-game character name, set `DISCORD_SYNC_NAMES` to `True`
|
||||
|
||||
## Managing Roles
|
||||
|
||||
Once users link their accounts you’ll notice Roles get populated on Discord. These are the equivalent to Groups on every other service. The default permissions should be enough for members to use text and audio communications. Add more permissions to the roles as desired through the server management window.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "Unknown Error" on Discord site when activating service
|
||||
This indicates your callback URL doesn't match. Ensure the `DISCORD_CALLBACK_URL` setting exactly matches the URL entered on the Discord developers site. This includes http(s), trailing slash, etc.
|
||||
|
||||
This indicates your callback URL doesn't match. Ensure the `DISCORD_CALLBACK_URL` setting exactly matches the URL entered on the Discord developers site. This includes http(s), trailing slash, etc.
|
||||
@@ -1,17 +1,19 @@
|
||||
# Discourse
|
||||
|
||||
## Prepare Your Settings
|
||||
|
||||
In your auth project's settings file, do the following:
|
||||
- Add `'allianceauth.services.modules.discourse',` to your `INSTALLED_APPS` list
|
||||
- Append the following to your local.py settings file:
|
||||
|
||||
- Add `'allianceauth.services.modules.discourse',` to your `INSTALLED_APPS` list
|
||||
- Append the following to your local.py settings file:
|
||||
|
||||
```python
|
||||
# Discourse Configuration
|
||||
DISCOURSE_URL = ''
|
||||
DISCOURSE_API_USERNAME = ''
|
||||
DISCOURSE_API_KEY = ''
|
||||
DISCOURSE_SSO_SECRET = ''
|
||||
|
||||
```
|
||||
|
||||
## Install Docker
|
||||
|
||||
@@ -31,9 +33,10 @@ In your auth project's settings file, do the following:
|
||||
nano containers/app.yml
|
||||
|
||||
Change the following:
|
||||
- `DISCOURSE_DEVELOPER_EMAILS` should be a list of admin account email addresses separated by commas.
|
||||
- `DISCOUSE_HOSTNAME` should be `discourse.example.com` or something similar.
|
||||
- Everything with `SMTP` depends on your mail settings. [There are plenty of free email services online recommended by Discourse](https://github.com/discourse/discourse/blob/master/docs/INSTALL-email.md#recommended-email-providers-for-discourse) if you haven't set one up for auth already.
|
||||
|
||||
- `DISCOURSE_DEVELOPER_EMAILS` should be a list of admin account email addresses separated by commas.
|
||||
- `DISCOUSE_HOSTNAME` should be `discourse.example.com` or something similar.
|
||||
- Everything with `SMTP` depends on your mail settings. [There are plenty of free email services online recommended by Discourse](https://github.com/discourse/discourse/blob/master/docs/INSTALL-email.md#recommended-email-providers-for-discourse) if you haven't set one up for auth already.
|
||||
|
||||
To install behind Apache/Nginx, look for this section:
|
||||
|
||||
@@ -109,16 +112,18 @@ Follow prompts, being sure to answer `y` when asked to allow admin privileges.
|
||||
Navigate to `discourse.example.com` and log on. Top right press the 3 lines and select `Admin`. Go to API tab and press `Generate Master API Key`.
|
||||
|
||||
Add the following values to your auth project's settings file:
|
||||
- `DISCOURSE_URL`: `https://discourse.example.com` (do not add a trailing slash!)
|
||||
- `DISCOURSE_API_USERNAME`: the username of the admin account you generated the API key with
|
||||
- `DISCOURSE_API_KEY`: the key you just generated
|
||||
|
||||
- `DISCOURSE_URL`: `https://discourse.example.com` (do not add a trailing slash!)
|
||||
- `DISCOURSE_API_USERNAME`: the username of the admin account you generated the API key with
|
||||
- `DISCOURSE_API_KEY`: the key you just generated
|
||||
|
||||
### Configure SSO
|
||||
|
||||
Navigate to `discourse.example.com` and log in. Back to the admin site, scroll down to find SSO settings and set the following:
|
||||
- `enable_sso`: True
|
||||
- `sso_url`: `http://example.com/discourse/sso`
|
||||
- `sso_secret`: some secure key
|
||||
|
||||
- `enable_sso`: True
|
||||
- `sso_url`: `http://example.com/discourse/sso`
|
||||
- `sso_secret`: some secure key
|
||||
|
||||
Save, now set `DISCOURSE_SSO_SECRET` in your auth project's settings file to the secure key you just put in Discourse.
|
||||
|
||||
29
docs/features/services/index.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Services
|
||||
|
||||
**Alliance Auth** supports managing access to many 3rd party services and apps. This section describes which services are supported and how to install and configure them. Please note that any service need to be installed and configured before it can be used.
|
||||
|
||||
## Supported Services
|
||||
|
||||
```eval_rst
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
discord
|
||||
discourse
|
||||
mumble
|
||||
openfire
|
||||
phpbb3
|
||||
smf
|
||||
teamspeak3
|
||||
xenforo
|
||||
```
|
||||
|
||||
## Tools
|
||||
|
||||
```eval_rst
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
nameformats
|
||||
permissions
|
||||
```
|
||||
@@ -5,9 +5,10 @@ In your auth project's settings file, do the following:
|
||||
- Add `'allianceauth.services.modules.mumble',` to your `INSTALLED_APPS` list
|
||||
- Append the following to your local.py settings file:
|
||||
|
||||
|
||||
```python
|
||||
# Mumble Configuration
|
||||
MUMBLE_URL = ""
|
||||
```
|
||||
|
||||
## Overview
|
||||
Mumble is a free voice chat server. While not as flashy as TeamSpeak, it has all the functionality and is easier to customize. And is better. I may be slightly biased.
|
||||
@@ -1,11 +1,8 @@
|
||||
# Services Name Formats
|
||||
|
||||
```eval_rst
|
||||
.. note::
|
||||
New in 2.0
|
||||
```
|
||||
This app allows you to customize how usernames for services are created.
|
||||
|
||||
Each service's username or nickname, depending on which the service supports, can be customised through the use of the Name Formatter config provided the service supports custom formats. This config can be found in the admin panel under **Services -> Name format config**
|
||||
Each service's username or nickname, depending on which the service supports, can be customized through the use of the Name Formatter config provided the service supports custom formats. This config can be found in the admin panel under **Services -> Name format config**
|
||||
|
||||
Currently the following services support custom name formats:
|
||||
|
||||
@@ -35,24 +32,24 @@ Currently the following services support custom name formats:
|
||||
|
||||
```eval_rst
|
||||
.. note::
|
||||
It's important to note here, before we get into what you can do with a name formatter, that before the generated name is passed off to the service to create an account it will be sanitised to remove characters (the letters and numbers etc.) that the service cannot support. This means that, despite what you configured, the service may display something different. It is up to you to test your formatter and understand how your format may be disrupted by a certain services sanitisation function.
|
||||
It's important to note here, before we get into what you can do with a name formatter, that before the generated name is passed off to the service to create an account it will be sanitized to remove characters (the letters and numbers etc.) that the service cannot support. This means that, despite what you configured, the service may display something different. It is up to you to test your formatter and understand how your format may be disrupted by a certain services sanitization function.
|
||||
```
|
||||
|
||||
## Available format data
|
||||
|
||||
The following fields are available from a users account and main character:
|
||||
|
||||
- `username` - Alliance Auth username
|
||||
- `character_id`
|
||||
- `character_name`
|
||||
- `corp_id`
|
||||
- `corp_name`
|
||||
- `corp_ticker`
|
||||
- `alliance_id`
|
||||
- `alliance_name`
|
||||
- `alliance_ticker`
|
||||
- `alliance_or_corp_name` (defaults to Corporation name if there is no Alliance)
|
||||
- `alliance_or_corp_ticker` (defaults to Corporation ticker if there is no Alliance)
|
||||
- `username` - Alliance Auth username
|
||||
- `character_id`
|
||||
- `character_name`
|
||||
- `corp_id`
|
||||
- `corp_name`
|
||||
- `corp_ticker`
|
||||
- `alliance_id`
|
||||
- `alliance_name`
|
||||
- `alliance_ticker`
|
||||
- `alliance_or_corp_name` (defaults to Corporation name if there is no Alliance)
|
||||
- `alliance_or_corp_ticker` (defaults to Corporation ticker if there is no Alliance)
|
||||
|
||||
## Building a formatter string
|
||||
|
||||
@@ -61,6 +58,7 @@ The name formatter uses the advanced string formatting specified by [PEP-3101](h
|
||||
A more digestible documentation of string formatting in Python is available on the [PyFormat](https://pyformat.info/) website.
|
||||
|
||||
Some examples of strings you could use:
|
||||
|
||||
```eval_rst
|
||||
+------------------------------------------+---------------------------+
|
||||
| Formatter | Result |
|
||||
@@ -3,10 +3,11 @@
|
||||
Openfire is a Jabber (XMPP) server.
|
||||
|
||||
## Prepare Your Settings
|
||||
- Add `'allianceauth.services.modules.openfire',` to your `INSTALLED_APPS` list
|
||||
- Append the following to your auth project's settings file:
|
||||
|
||||
- Add `'allianceauth.services.modules.openfire',` to your `INSTALLED_APPS` list
|
||||
- Append the following to your auth project's settings file:
|
||||
|
||||
```python
|
||||
# Jabber Configuration
|
||||
JABBER_URL = ""
|
||||
JABBER_PORT = 5223
|
||||
@@ -16,6 +17,7 @@
|
||||
BROADCAST_USER = ""
|
||||
BROADCAST_USER_PASSWORD = ""
|
||||
BROADCAST_SERVICE_NAME = "broadcast"
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
Openfire require a Java 8 runtime environment.
|
||||
@@ -11,7 +11,7 @@ In your auth project's settings file, do the following:
|
||||
- Add `'allianceauth.services.modules.phpbb3',` to your `INSTALLED_APPS` list
|
||||
- Append the following to the bottom of the settings file:
|
||||
|
||||
|
||||
```python
|
||||
# PHPBB3 Configuration
|
||||
PHPBB3_URL = ''
|
||||
DATABASES['phpbb3'] = {
|
||||
@@ -22,6 +22,7 @@ In your auth project's settings file, do the following:
|
||||
'HOST': '127.0.0.1',
|
||||
'PORT': '3306',
|
||||
}
|
||||
```
|
||||
|
||||
## Setup
|
||||
### Prepare the Database
|
||||
@@ -136,14 +137,11 @@ Before users can see the forums, we need to remove the install directory
|
||||
rm -rf /var/www/forums/install
|
||||
|
||||
### Enabling Avatars
|
||||
|
||||
AllianceAuth sets user avatars to their character portrait when the account is created or password reset. We need to allow external URLs for avatars for them to behave properly. Navigate to the admin control panel for phpbb3, and under the `General` tab, along the left navigation bar beneath `Board Configuration`, select `Avatar Settings`. Set `Enable Remote Avatars` to `Yes` and then `Submit`.
|
||||
|
||||

|
||||
|
||||
You can allow members to overwrite the portrait with a custom image if desired. Navigate to `Users and Groups`, `Group Permissions`, select the appropriate group (usually `Member` if you want everyone to have this ability), expand `Advanced Permissions`, under the `Profile` tab, set `Can Change Avatars` to `Yes`, and press `Apply Permissions`.
|
||||
|
||||

|
||||
|
||||
## Setting the default theme
|
||||
|
||||
Users generated via Alliance Auth do not have a default theme set. You will need to set this on the phpbb_users table in SQL
|
||||
@@ -11,7 +11,7 @@ In your auth project's settings file, do the following:
|
||||
- Add `'allianceauth.services.modules.smf',` to your `INSTALLED_APPS` list
|
||||
- Append the following to the bottom of the settings file:
|
||||
|
||||
|
||||
```python
|
||||
# SMF Configuration
|
||||
SMF_URL = ''
|
||||
DATABASES['smf'] = {
|
||||
@@ -22,6 +22,7 @@ In your auth project's settings file, do the following:
|
||||
'HOST': '127.0.0.1',
|
||||
'PORT': '3306',
|
||||
}
|
||||
```
|
||||
|
||||
## Setup
|
||||
### Download SMF
|
||||
@@ -13,7 +13,7 @@ In your auth project's settings file, do the following:
|
||||
- Add `'allianceauth.services.modules.teamspeak3',` to your `INSTALLED_APPS` list
|
||||
- Append the following to the bottom of the settings file:
|
||||
|
||||
|
||||
```python
|
||||
# Teamspeak3 Configuration
|
||||
TEAMSPEAK3_SERVER_IP = '127.0.0.1'
|
||||
TEAMSPEAK3_SERVER_PORT = 10011
|
||||
@@ -26,6 +26,7 @@ In your auth project's settings file, do the following:
|
||||
'task': 'allianceauth.services.modules.teamspeak3.tasks.run_ts3_group_update',
|
||||
'schedule': crontab(minute='*/30'),
|
||||
}
|
||||
```
|
||||
|
||||
### Download Installer
|
||||
To install we need a copy of the server. You can find the latest version from [this dl server](http://dl.4players.de/ts/releases/) (I’d recommend getting the latest stable version – find this version number from the [TeamSpeak site](https://www.teamspeak.com/downloads#)). Be sure to get a link to the Linux version.
|
||||
@@ -8,11 +8,12 @@ In your auth project's settings file, do the following:
|
||||
- Add `'allianceauth.services.modules.xenforo',` to your `INSTALLED_APPS` list
|
||||
- Append the following to your local.py settings file:
|
||||
|
||||
|
||||
```python
|
||||
# XenForo Configuration
|
||||
XENFORO_ENDPOINT = 'example.com/api.php'
|
||||
XENFORO_DEFAULT_GROUP = 0
|
||||
XENFORO_APIKEY = 'yourapikey'
|
||||
```
|
||||
|
||||
## XenAPI
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
# SRP
|
||||
|
||||
## Installation
|
||||
|
||||
Add `'allianceauth.srp',` to your `INSTALLED_APPS` list in your auth project's settings file. Run migrations to complete installation.
|
||||