From 3058ffaf0508e86f8d34ca6c3310b6be4a7e4ecc Mon Sep 17 00:00:00 2001 From: orbitroom Date: Wed, 3 Feb 2016 02:37:49 -0500 Subject: [PATCH 1/9] fixed corp utils menu bug --- stock/templates/registered/corputils.html | 374 +++++++++++----------- 1 file changed, 187 insertions(+), 187 deletions(-) diff --git a/stock/templates/registered/corputils.html b/stock/templates/registered/corputils.html index 7529f890..708f3996 100644 --- a/stock/templates/registered/corputils.html +++ b/stock/templates/registered/corputils.html @@ -1,187 +1,187 @@ -{% extends "public/base.html" %} -{% load bootstrap %} -{% load staticfiles %} - -{% block title %}Alliance Auth{% endblock %} -{% block page_title %}Corporation Member Tracking{% endblock page_title %} - -{% block content %} - -
-

Corporation Member Data

- {% if perms.auth.corputils %} -
- {% if corp %} -
-
-
-
Corporation
-
-
- -
-
-

{{ corp.corporation_name }}

- -

Ticker: {{ corp.corporation_ticker }}

- -

Member count: {{ corp.member_count }}

- -

Player count: {{characters_with_api|length}}

- -

Unregistered characters: {{characters_without_api|length}}

-
-
- API Index: -
-
- {{characters_with_api|length}}/{{ corp.member_count }} -
-
-
-
-
-
-
- - -
-
- {% if characters_with_api %} -
-
- - - - - - - - - {% for maincharname, player in characters_with_api %} - - - - - - - - {% endfor %} -
Main characterMain corporationCharacter listKillboard
- - -

{{ maincharname }}

-
- {% if not corp.corporation_name == player.maincorp%} - - {{ player.maincorp }} - - {% else %} - - {{ player.maincorp }} - - {% endif %} - - {% for char in player.altlist %} -

{{ char.character_name }}

- {% endfor %} -
- {% for char in player.altlist %} -

Killboard

- {% endfor %} -
-
-
- {% else %} - - {% endif %} -
-
- {% if characters_without_api %} -
-
- - - - - - - {% for character_name, character_id in characters_without_api %} - - - - - - {% endfor %} -
CharacterKillboard
- - -

{{ character_name }}

-
- Killboard -
-
-
- {% else %} - - {% endif %} -
-
- {% else %} -
-
-
- -
-
-
-
- {% endif %} -
- {% else %} - {% if IS_CORP %} - - {% else %} - - {% endif %} - {% endif %} - -{% endblock content %} +{% extends "public/base.html" %} +{% load bootstrap %} +{% load staticfiles %} + +{% block title %}Alliance Auth{% endblock %} +{% block page_title %}Corporation Member Tracking{% endblock page_title %} + +{% block content %} + +
+

Corporation Member Data

+ {% if perms.auth.corputils %} +
+ {% if corp %} +
+
+
+
Corporation
+
+
+ +
+
+

{{ corp.corporation_name }}

+ +

Ticker: {{ corp.corporation_ticker }}

+ +

Member count: {{ corp.member_count }}

+ +

Player count: {{characters_with_api|length}}

+ +

Unregistered characters: {{characters_without_api|length}}

+
+
+ API Index: +
+
+ {{characters_with_api|length}}/{{ corp.member_count }} +
+
+
+
+
+
+
+ + +
+
+ {% if characters_with_api %} +
+
+ + + + + + + + + {% for maincharname, player in characters_with_api %} + + + + + + + + {% endfor %} +
Main characterMain corporationCharacter listKillboard
+ + +

{{ maincharname }}

+
+ {% if not corp.corporation_name == player.maincorp%} + + {{ player.maincorp }} + + {% else %} + + {{ player.maincorp }} + + {% endif %} + + {% for char in player.altlist %} +

{{ char.character_name }}

+ {% endfor %} +
+ {% for char in player.altlist %} +

Killboard

+ {% endfor %} +
+
+
+ {% else %} + + {% endif %} +
+
+ {% if characters_without_api %} +
+
+ + + + + + + {% for character_name, character_id in characters_without_api %} + + + + + + {% endfor %} +
CharacterKillboard
+ + +

{{ character_name }}

+
+ Killboard +
+
+
+ {% else %} + + {% endif %} +
+
+ {% else %} +
+
+
+ +
+
+
+
+ {% endif %} +
+ {% else %} + {% if IS_CORP %} + + {% else %} + + {% endif %} + {% endif %} + +{% endblock content %} From 7e760d4a564f729ff69d3f21f7cbc89837bbe97d Mon Sep 17 00:00:00 2001 From: Trent Bartlem Date: Wed, 3 Feb 2016 21:14:17 +1000 Subject: [PATCH 2/9] log api key invalidation at INFO level Deletion of characters associated with an API key is logged at INFO. However, the reason that an API key is marked invalid in the first place is only logged at DEBUG, so if you have debug logging disabled, you won't know why. --- services/managers/eve_api_manager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/managers/eve_api_manager.py b/services/managers/eve_api_manager.py index 6d5f1964..1f17bd73 100644 --- a/services/managers/eve_api_manager.py +++ b/services/managers/eve_api_manager.py @@ -287,11 +287,11 @@ class EveApiManager(): def validate_member_api(api_id, api_key): if settings.MEMBER_API_ACCOUNT: if EveApiManager.check_api_is_type_account(api_id, api_key) is not True: - logger.debug("Api id %s is not type account as required for members - failed validation." % api_id) + logger.info("Api id %s is not type account as required for members - failed validation." % api_id) return False if EveApiManager.check_api_is_full(api_id, api_key) is not True: - logger.debug("Api id %s does not meet member access mask requirements - failed validation." % api_id) + logger.info("Api id %s does not meet member access mask requirements - failed validation." % api_id) return False return True @@ -299,9 +299,9 @@ class EveApiManager(): def validate_blue_api(api_id, api_key): if settings.BLUE_API_ACCOUNT: if EveApiManager.check_api_is_type_account(api_id, api_key) is not True: - logger.debug("Api id %s is not type account as required for blues - failed validation." % api_id) + logger.info("Api id %s is not type account as required for blues - failed validation." % api_id) return False if EveApiManager.check_blue_api_is_full(api_id, api_key) is not True: - logger.debug("Api id %s does not meet minimum blue access mask requirements - failed validation." % api_id) + logger.info("Api id %s does not meet minimum blue access mask requirements - failed validation." % api_id) return False return True From 82f8141ff72108710ab60803db60e9bdff7dcace Mon Sep 17 00:00:00 2001 From: kallama Date: Wed, 3 Feb 2016 16:08:00 -0800 Subject: [PATCH 3/9] Eve avatar url as https Eve avatar url should be https instead of http so you don't get a mixed content warning if you use https on your forum. The ultimate solution would be http/https agnostic with :// instead, but I don't know if that would work in this file. --- services/managers/phpbb3_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/managers/phpbb3_manager.py b/services/managers/phpbb3_manager.py index 1ffe7046..bb38aa37 100755 --- a/services/managers/phpbb3_manager.py +++ b/services/managers/phpbb3_manager.py @@ -47,7 +47,7 @@ class Phpbb3Manager: @staticmethod def __add_avatar(username, characterid): logger.debug("Adding EVE character id %s portrait as phpbb avater for user %s" % (characterid, username)) - avatar_url = "http://image.eveonline.com/Character/" + characterid + "_64.jpg" + avatar_url = "https://image.eveonline.com/Character/" + characterid + "_64.jpg" cursor = connections['phpbb3'].cursor() userid = Phpbb3Manager.__get_user_id(username) cursor.execute(Phpbb3Manager.SQL_ADD_USER_AVATAR, [avatar_url, userid]) From 49d2e6251b037456c3ff52dfb06e849c10b9e9e4 Mon Sep 17 00:00:00 2001 From: Mr McClain Date: Sat, 6 Feb 2016 13:28:05 -0600 Subject: [PATCH 4/9] Added Additonal Signature Types and Status --- sigtracker/form.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sigtracker/form.py b/sigtracker/form.py index accb7cce..c92511bf 100644 --- a/sigtracker/form.py +++ b/sigtracker/form.py @@ -5,8 +5,12 @@ from django.core.validators import MaxValueValidator, MinValueValidator class SignatureForm(forms.Form): sigtype = [('Wormhole', 'Wormhole'), ('Combat', 'Combat'), ('Data', 'Data'), - ('Relic', 'Relic')] - status = [('Open', 'Open'), ('Started', 'Started'), ('Finished', 'Finished')] + ('Relic', 'Relic'), ('Gas', 'Gas'), ('Ore', 'Ore')] + status = [('Open', 'Open'), ('Started', 'Started'), ('Finished', 'Finished'), ('Life cycle has not begun', 'Life cycle has not begun'), + ('Probably wont last another day', 'Probably wont last another day'), ('Reaching the end of its natural lifetime', 'Reaching the end of its natural lifetime'), + ('Has not yet had its stability significantly disrupted', 'Has not yet had its stability significantly disrupted'), + ('Has had its stability reduced, but not to a critical degree yet', 'Has had its stability reduced, but not to a critical degree yet') + ('This wormhole has had its stability critically disrupted', 'This wormhole has had its stability critically disrupted')] system = forms.CharField(max_length=254, required=True, label='System') ident = forms.CharField(max_length=254, required=True, label="ID") From c48902ecf8fc5c64243a4a7a46482ee7e4b68240 Mon Sep 17 00:00:00 2001 From: orbitroom Date: Sat, 6 Feb 2016 14:45:39 -0500 Subject: [PATCH 5/9] Added Types and Status --- sigtracker/form.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sigtracker/form.py b/sigtracker/form.py index c92511bf..108a5954 100644 --- a/sigtracker/form.py +++ b/sigtracker/form.py @@ -7,10 +7,10 @@ class SignatureForm(forms.Form): sigtype = [('Wormhole', 'Wormhole'), ('Combat', 'Combat'), ('Data', 'Data'), ('Relic', 'Relic'), ('Gas', 'Gas'), ('Ore', 'Ore')] status = [('Open', 'Open'), ('Started', 'Started'), ('Finished', 'Finished'), ('Life cycle has not begun', 'Life cycle has not begun'), - ('Probably wont last another day', 'Probably wont last another day'), ('Reaching the end of its natural lifetime', 'Reaching the end of its natural lifetime'), - ('Has not yet had its stability significantly disrupted', 'Has not yet had its stability significantly disrupted'), - ('Has had its stability reduced, but not to a critical degree yet', 'Has had its stability reduced, but not to a critical degree yet') - ('This wormhole has had its stability critically disrupted', 'This wormhole has had its stability critically disrupted')] + ('Probably wont last another day', 'Probably wont last another day'), ('End of its natural lifetime', 'End of its natural lifetime'), + ('stability not significantly disrupted', 'stability not significantly disrupted'), + ('Stability reduced not critical degree yet', 'Stability reduced not critical degree yet'), + ('Wormhole stability critically disrupted', 'Wormhole stability critically disrupted')] system = forms.CharField(max_length=254, required=True, label='System') ident = forms.CharField(max_length=254, required=True, label="ID") From 9d6cbb325b343d8bbe148a98dce05085a7c759fb Mon Sep 17 00:00:00 2001 From: orbitroom Date: Sun, 7 Feb 2016 09:45:04 -0500 Subject: [PATCH 6/9] Fixed logout logging to show actual user --- authentication/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/authentication/views.py b/authentication/views.py index 5dc123ac..2e1ce349 100644 --- a/authentication/views.py +++ b/authentication/views.py @@ -40,6 +40,7 @@ def login_user(request): def logout_user(request): logger.debug("logout_user called by user %s" % request.user) + logoutUser = request.user logout(request) - logger.info("Successful logout for user %s" % request.user) + logger.info("Successful logout for user %s" % logoutUser) return HttpResponseRedirect("/") From 28f5055eee2b8e7c4ae526ed8e53543c693052bd Mon Sep 17 00:00:00 2001 From: Mr McClain Date: Sun, 7 Feb 2016 15:13:07 -0600 Subject: [PATCH 7/9] Removed Redundant Lieing Code --- celerytask/tasks.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/celerytask/tasks.py b/celerytask/tasks.py index e8a92e83..d446a78f 100755 --- a/celerytask/tasks.py +++ b/celerytask/tasks.py @@ -480,8 +480,6 @@ def run_api_refresh(): logger.info("User %s main character id %s missing model. Clearning main character." % (user, authserviceinfo.main_char_id)) authserviceinfo.main_char_id = '' authserviceinfo.save() - else: - logger.warn("User %s has no main character id, unable to validate membership.") set_state(user) From 56ddee22f858673b59ff45cabb1c2fb8717a9400 Mon Sep 17 00:00:00 2001 From: Mr McClain Date: Sun, 7 Feb 2016 15:24:19 -0600 Subject: [PATCH 8/9] Updated Logging To remove spam from logs. --- services/managers/teamspeak3_manager.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/services/managers/teamspeak3_manager.py b/services/managers/teamspeak3_manager.py index 1bc86067..df006c73 100755 --- a/services/managers/teamspeak3_manager.py +++ b/services/managers/teamspeak3_manager.py @@ -279,13 +279,11 @@ class Teamspeak3Manager: if user_ts_groups[user_ts_group_key] not in ts_groups.values(): remgroups.append(user_ts_groups[user_ts_group_key]) - logger.info("Finished checking user id %s TS3 groups - adding %s, removing %s." % (userid, addgroups, remgroups)) - for g in addgroups: - logger.debug("Issuing add command for group %s" % g) + logger.info("Adding Teamspeak user %s into group %s" % (userid, g)) Teamspeak3Manager._add_user_to_group(userid, g) for g in remgroups: - logger.debug("Issuing remove command for group %s" % g) + logger.info("Removing Teamspeak user %s for group %s" % (useid, g)) Teamspeak3Manager._remove_user_from_group(userid, g) From 5839d64cb72f73882d76c1f48ba60bb3aaf2eab4 Mon Sep 17 00:00:00 2001 From: Mr McClain Date: Sun, 7 Feb 2016 15:28:58 -0600 Subject: [PATCH 9/9] Updated Logging because I cant Spell --- services/managers/teamspeak3_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/managers/teamspeak3_manager.py b/services/managers/teamspeak3_manager.py index df006c73..d4959fe3 100755 --- a/services/managers/teamspeak3_manager.py +++ b/services/managers/teamspeak3_manager.py @@ -284,6 +284,6 @@ class Teamspeak3Manager: Teamspeak3Manager._add_user_to_group(userid, g) for g in remgroups: - logger.info("Removing Teamspeak user %s for group %s" % (useid, g)) + logger.info("Removing Teamspeak user %s from group %s" % (userid, g)) Teamspeak3Manager._remove_user_from_group(userid, g)