mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-16 16:00:17 +02:00
Merge remote-tracking branch 'refs/remotes/R4stl1n/master'
This commit is contained in:
commit
6e9f08520a
@ -161,7 +161,7 @@ STATIC_URL = '/static/'
|
||||
# Set to FALSE for alliance
|
||||
# Set to TRUE for corp
|
||||
###########################
|
||||
IS_CORP = 'False' == os.environ.get('AA_IS_CORP', 'True')
|
||||
IS_CORP = 'True' == os.environ.get('AA_IS_CORP', 'True')
|
||||
|
||||
|
||||
#################
|
||||
|
@ -211,6 +211,8 @@ def run_api_refresh():
|
||||
if authserviceinfo.main_char_id:
|
||||
if authserviceinfo.main_char_id != "":
|
||||
#preserve old corp ID for corp change test on members
|
||||
oldcorp_id = 0
|
||||
if EveManager.get_character_by_id(authserviceinfo.main_char_id):
|
||||
oldcorp_id = EveCharacter.objects.get(character_id=authserviceinfo.main_char_id).corporation_id
|
||||
for api_key_pair in api_key_pairs:
|
||||
print 'Running on ' + api_key_pair.api_id + ':' + api_key_pair.api_key
|
||||
@ -227,6 +229,7 @@ def run_api_refresh():
|
||||
if valid_key:
|
||||
# Check our main character
|
||||
character = EveManager.get_character_by_id(authserviceinfo.main_char_id)
|
||||
if character is not None and EveManager.check_if_corporation_exists_by_id(character.corporation_id):
|
||||
corp = EveManager.get_corporation_info_by_id(character.corporation_id)
|
||||
main_corp_id = EveManager.get_charater_corporation_id_by_id(authserviceinfo.main_char_id)
|
||||
main_alliance_id = EveManager.get_charater_alliance_id_by_id(authserviceinfo.main_char_id)
|
||||
@ -279,7 +282,13 @@ def run_api_refresh():
|
||||
disable_blue_member(user)
|
||||
else:
|
||||
deactivate_services(user)
|
||||
|
||||
else:
|
||||
if check_if_user_has_permission(user, "member"):
|
||||
disable_alliance_member(user, authserviceinfo.main_char_id)
|
||||
elif check_if_user_has_permission(user, "blue_member"):
|
||||
disable_blue_member(user)
|
||||
else:
|
||||
deactivate_services(user)
|
||||
else:
|
||||
# disable accounts with invalid keys
|
||||
if check_if_user_has_permission(user, "member"):
|
||||
@ -419,7 +428,7 @@ def run_corp_update():
|
||||
# Remove irrelevent corp and alliance models
|
||||
# Check the corps
|
||||
for all_corp_info in EveManager.get_all_corporation_info():
|
||||
if (settings.IS_CORP and all_corp_info.corporation_id != settings.CORP_ID) or (not settings.IS_CORP and all_corp_info.alliance_id != settings.ALLIANCE_ID):
|
||||
if (settings.IS_CORP and all_corp_info.corporation_id != settings.CORP_ID) or (not settings.IS_CORP and all_corp_info.alliance.alliance_id != settings.ALLIANCE_ID):
|
||||
if not all_corp_info.is_blue:
|
||||
all_corp_info.delete()
|
||||
|
||||
@ -428,7 +437,3 @@ def run_corp_update():
|
||||
if (not settings.IS_CORP and all_alliance_info.alliance_id != settings.ALLIANCE_ID):
|
||||
if all_alliance_info.is_blue is not True:
|
||||
all_alliance_info.delete()
|
||||
if all_alliance_info.is_blue is not True:
|
||||
all_alliance_info.delete()
|
||||
|
||||
|
||||
|
@ -2,7 +2,9 @@ from django.contrib import admin
|
||||
|
||||
from models import GroupDescription
|
||||
from models import GroupRequest
|
||||
from models import HiddenGroup
|
||||
|
||||
|
||||
admin.site.register(GroupDescription)
|
||||
admin.site.register(GroupRequest)
|
||||
admin.site.register(HiddenGroup)
|
||||
|
@ -22,3 +22,9 @@ class GroupRequest(models.Model):
|
||||
|
||||
def __str__(self):
|
||||
return self.user.username + ":" + self.group.name
|
||||
|
||||
class HiddenGroup(models.Model):
|
||||
group = models.ForeignKey(Group, unique=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.group.name + " - Hidden"
|
||||
|
@ -8,6 +8,7 @@ from django.contrib.auth.models import Group
|
||||
|
||||
from models import GroupDescription
|
||||
from models import GroupRequest
|
||||
from models import HiddenGroup
|
||||
from authentication.managers import AuthServicesInfoManager
|
||||
from eveonline.managers import EveManager
|
||||
|
||||
@ -100,6 +101,8 @@ def groups_view(request):
|
||||
pass
|
||||
elif settings.DEFAULT_BLUE_GROUP in group.name:
|
||||
pass
|
||||
elif HiddenGroup.objects.filter(group=group).exists():
|
||||
pass
|
||||
else:
|
||||
# Get the descriptionn
|
||||
groupDesc = GroupDescription.objects.filter(group=group)
|
||||
|
@ -3,7 +3,7 @@ from django.contrib.auth.models import User
|
||||
|
||||
|
||||
class RegistrationForm(forms.Form):
|
||||
username = forms.CharField(max_length=32, required=True)
|
||||
username = forms.CharField(max_length=30, required=True)
|
||||
password = forms.CharField(widget=forms.PasswordInput(), required=True)
|
||||
password_again = forms.CharField(widget=forms.PasswordInput(), required=True, label="Password Again")
|
||||
email = forms.CharField(max_length=254, required=True)
|
||||
|
@ -32,9 +32,18 @@ class Phpbb3Manager:
|
||||
SQL_GET_USER_GROUPS = r"SELECT phpbb_groups.group_name FROM phpbb_groups , phpbb_user_group WHERE " \
|
||||
r"phpbb_user_group.group_id = phpbb_groups.group_id AND user_id=%s"
|
||||
|
||||
SQL_ADD_USER_AVATAR = r"UPDATE phpbb_users SET user_avatar_type=2, user_avatar_width=64, user_avatar_height=64, user_avatar=%s WHERE user_id = %s"
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def __add_avatar(username, characterid):
|
||||
avatar_url = "http://image.eveonline.com/Character/" + characterid + "_64.jpg"
|
||||
cursor = connections['phpbb3'].cursor()
|
||||
userid = Phpbb3Manager.__get_user_id(username)
|
||||
cursor.execute(Phpbb3Manager.SQL_ADD_USER_AVATAR, [avatar_url, userid])
|
||||
|
||||
@staticmethod
|
||||
def __generate_random_pass():
|
||||
return os.urandom(8).encode('hex')
|
||||
@ -113,7 +122,7 @@ class Phpbb3Manager:
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def add_user(username, email, groups):
|
||||
def add_user(username, email, groups, characterid):
|
||||
cursor = connections['phpbb3'].cursor()
|
||||
|
||||
username_clean = Phpbb3Manager.__santatize_username(username)
|
||||
@ -130,6 +139,7 @@ class Phpbb3Manager:
|
||||
email, 2, Phpbb3Manager.__get_current_utc_date(),
|
||||
"", ""])
|
||||
Phpbb3Manager.update_groups(username_clean, groups)
|
||||
Phpbb3Manager.__add_avatar(username_clean, characterid)
|
||||
except:
|
||||
pass
|
||||
|
||||
@ -203,12 +213,13 @@ class Phpbb3Manager:
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
def update_user_password(username):
|
||||
def update_user_password(username, characterid):
|
||||
cursor = connections['phpbb3'].cursor()
|
||||
password = Phpbb3Manager.__generate_random_pass()
|
||||
if Phpbb3Manager.check_user(username):
|
||||
pwhash = Phpbb3Manager.__gen_hash(password)
|
||||
cursor.execute(Phpbb3Manager.SQL_UPDATE_USER_PASSWORD, [pwhash, username])
|
||||
Phpbb3Manager.__add_avatar(username, characterid)
|
||||
return password
|
||||
|
||||
return ""
|
||||
|
@ -115,6 +115,7 @@ class Teamspeak3Manager:
|
||||
|
||||
@staticmethod
|
||||
def _sync_ts_group_db():
|
||||
try:
|
||||
remote_groups = Teamspeak3Manager._group_list()
|
||||
local_groups = TSgroup.objects.all()
|
||||
for key in remote_groups:
|
||||
@ -128,6 +129,8 @@ class Teamspeak3Manager:
|
||||
q = TSgroup.objects.filter(ts_group_id=g.ts_group_id)
|
||||
if not q:
|
||||
g.save()
|
||||
except:
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def add_user(username, corp_ticker):
|
||||
@ -139,9 +142,9 @@ class Teamspeak3Manager:
|
||||
server_groups = Teamspeak3Manager._group_list()
|
||||
|
||||
if not settings.DEFAULT_AUTH_GROUP in server_groups:
|
||||
Teamspeak3Manager._create_group(settings.DEFAULT_ALLIANCE_GROUP)
|
||||
Teamspeak3Manager._create_group(settings.DEFAULT_AUTH_GROUP)
|
||||
|
||||
alliance_group_id = Teamspeak3Manager._group_id_by_name(settings.DEFAULT_ALLIANCE_GROUP)
|
||||
alliance_group_id = Teamspeak3Manager._group_id_by_name(settings.DEFAULT_AUTH_GROUP)
|
||||
|
||||
ret = server.send_command('tokenadd', {'tokentype': 0, 'tokenid1': alliance_group_id, 'tokenid2': 0,
|
||||
'tokendescription': username_clean,
|
||||
|
@ -139,7 +139,8 @@ class TS3Proto():
|
||||
v = [v[0], '='.join(v[1:])]
|
||||
key, value = v
|
||||
keys[key] = self._unescape_str(value)
|
||||
elif v[0][0] and v[0][0] == '-':
|
||||
elif (not v == ['']):
|
||||
if v[0][0] and v[0][0] == '-':
|
||||
# Option
|
||||
opts.append(v[0][1:])
|
||||
else:
|
||||
|
@ -100,7 +100,7 @@ def activate_forum(request):
|
||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||
# Valid now we get the main characters
|
||||
character = EveManager.get_character_by_id(authinfo.main_char_id)
|
||||
result = Phpbb3Manager.add_user(character.character_name, request.user.email, ['REGISTERED'])
|
||||
result = Phpbb3Manager.add_user(character.character_name, request.user.email, ['REGISTERED'], authinfo.main_char_id)
|
||||
# if empty we failed
|
||||
if result[0] != "":
|
||||
AuthServicesInfoManager.update_user_forum_info(result[0], result[1], request.user)
|
||||
@ -126,7 +126,7 @@ def deactivate_forum(request):
|
||||
@user_passes_test(service_blue_alliance_test)
|
||||
def reset_forum_password(request):
|
||||
authinfo = AuthServicesInfoManager.get_auth_service_info(request.user)
|
||||
result = Phpbb3Manager.update_user_password(authinfo.forum_username)
|
||||
result = Phpbb3Manager.update_user_password(authinfo.forum_username, authinfo.main_char_id)
|
||||
# false we failed
|
||||
if result != "":
|
||||
AuthServicesInfoManager.update_user_forum_info(authinfo.forum_username, result, request.user)
|
||||
|
Binary file not shown.
@ -37,9 +37,9 @@
|
||||
<a class="navbar-brand ">
|
||||
<div class="fa fa-cog fa-spin"></div>
|
||||
{% if IS_CORP %}
|
||||
<title>{{ CORP_NAME }}</title>
|
||||
{{ CORP_NAME }}
|
||||
{% else %}
|
||||
<title>{{ ALLIANCE_NAME }}</title>
|
||||
{{ ALLIANCE_NAME }}
|
||||
{% endif %}
|
||||
</a>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
{% load staticfiles %}
|
||||
<style>
|
||||
html {
|
||||
background: url("{% static 'img/index_images/index_bg.jpg' %}") no-repeat center center fixed;
|
||||
background: url('{% static 'img/index_images/index_blank_bg.jpg' %}') no-repeat scroll;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
@ -17,15 +17,29 @@
|
||||
margin-top: -100px;
|
||||
margin-left: -200px;
|
||||
}
|
||||
#logo {
|
||||
height: 200px;
|
||||
width: 900px;
|
||||
position: fixed;
|
||||
top: 20%;
|
||||
left: 50%;
|
||||
margin-top: -100px;
|
||||
margin-left: -450px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<title>The 99 Percent Eve Alliance</title>
|
||||
<title>My Corp and/or Alliance Name</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="logo">
|
||||
<p style="text-align:center">
|
||||
<img src="{% static 'img/index_images/logo.png' %}" border="0">
|
||||
</p>
|
||||
</div>
|
||||
<div id="content">
|
||||
<p style="text-align:center">
|
||||
<a href="/dashboard/">
|
||||
@ -44,12 +58,6 @@
|
||||
<img src="{% static 'img/index_images/killboard.png' %}" border="0">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p style="text-align:center">
|
||||
<a href="https://www.youtube.com/playlist?list=PLXM5OIn59G5Gn7eri-lWkXvE15oP5yUUk">
|
||||
<img src="{% static 'img/index_images/media.png' %}" border="0">
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -23,7 +23,10 @@
|
||||
<style>
|
||||
body {
|
||||
background: url('{% static 'img/index_images/index_blank_bg.jpg' %}') no-repeat scroll;
|
||||
background-size: 100% 100%;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.panel-transparent {
|
||||
|
@ -24,7 +24,10 @@
|
||||
<style>
|
||||
body {
|
||||
background: url('{% static 'img/index_images/index_blank_bg.jpg' %}') no-repeat scroll;
|
||||
background-size: 100% 100%;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.panel-transparent {
|
||||
|
@ -25,7 +25,10 @@
|
||||
<style>
|
||||
body {
|
||||
background: url('{% static 'img/index_images/index_blank_bg.jpg' %}') no-repeat scroll;
|
||||
background-size: 100% 100%;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.panel-transparent {
|
||||
|
@ -24,7 +24,10 @@
|
||||
<style>
|
||||
body {
|
||||
background: url('{% static 'img/index_images/index_blank_bg.jpg' %}') no-repeat scroll;
|
||||
background-size: 100% 100%;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.panel-transparent {
|
||||
|
@ -21,7 +21,10 @@
|
||||
<style>
|
||||
body {
|
||||
background: url('{% static 'img/index_images/index_blank_bg.jpg' %}') no-repeat scroll;
|
||||
background-size: 100% 100%;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.panel-transparent {
|
||||
|
@ -25,7 +25,10 @@
|
||||
<style>
|
||||
body {
|
||||
background: url('{% static 'img/index_images/index_blank_bg.jpg' %}') no-repeat scroll;
|
||||
background-size: 100% 100%;
|
||||
-webkit-background-size: cover;
|
||||
-moz-background-size: cover;
|
||||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.panel-transparent {
|
||||
|
Loading…
x
Reference in New Issue
Block a user