From 9897c0bbbabccf7e6578dc54a9f94b2a17d72a60 Mon Sep 17 00:00:00 2001 From: Adarnof Date: Wed, 8 Mar 2017 17:31:41 -0500 Subject: [PATCH 1/6] Provide mumble quick join link Add button titles to services --- alliance_auth/settings.py.example | 7 +++--- .../registered/discord_service_ctrl.html | 6 ++--- .../registered/discourse_service_ctrl.html | 2 +- services/modules/mumble/auth_hooks.py | 4 ++- .../registered/mumble_service_ctrl.html | 25 +++++++++++++++++++ stock/templates/registered/services_ctrl.html | 8 +++--- 6 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 services/modules/mumble/templates/registered/mumble_service_ctrl.html diff --git a/alliance_auth/settings.py.example b/alliance_auth/settings.py.example index cfc68fce..3454c46b 100644 --- a/alliance_auth/settings.py.example +++ b/alliance_auth/settings.py.example @@ -426,11 +426,10 @@ BROADCAST_SERVICE_NAME = os.environ.get('AA_BROADCAST_SERVICE_NAME', "broadcast" ###################################### # Mumble Configuration ###################################### -# MUMBLE_URL - Mumble server url -# MUMBLE_SERVER_ID - Mumble server id +# MUMBLE_URL - Mumble server host +# Do not include leading http:// or mumble:// ###################################### -MUMBLE_URL = os.environ.get('AA_MUMBLE_URL', "https://example.com") -MUMBLE_SERVER_ID = int(os.environ.get('AA_MUMBLE_SERVER_ID', '1')) +MUMBLE_URL = os.environ.get('AA_MUMBLE_URL', "example.com") ###################################### # PHPBB3 Configuration diff --git a/services/modules/discord/templates/registered/discord_service_ctrl.html b/services/modules/discord/templates/registered/discord_service_ctrl.html index 7b7fa34b..a2449910 100644 --- a/services/modules/discord/templates/registered/discord_service_ctrl.html +++ b/services/modules/discord/templates/registered/discord_service_ctrl.html @@ -7,14 +7,14 @@ https://discordapp.com {% if not discord_uid %} - + {% else %} - + - + {% endif %} diff --git a/services/modules/discourse/templates/registered/discourse_service_ctrl.html b/services/modules/discourse/templates/registered/discourse_service_ctrl.html index 7cae0cd2..e3c6d289 100644 --- a/services/modules/discourse/templates/registered/discourse_service_ctrl.html +++ b/services/modules/discourse/templates/registered/discourse_service_ctrl.html @@ -4,5 +4,5 @@ {{ char.character_name }} {{ DISCOURSE_URL }} - + diff --git a/services/modules/mumble/auth_hooks.py b/services/modules/mumble/auth_hooks.py index 4585744f..44f4024d 100644 --- a/services/modules/mumble/auth_hooks.py +++ b/services/modules/mumble/auth_hooks.py @@ -21,6 +21,7 @@ class MumbleService(ServicesHook): self.urlpatterns = urlpatterns self.service_url = settings.MUMBLE_URL self.access_perm = 'mumble.access_mumble' + self.service_ctrl_template = 'registered/mumble_service_ctrl.html' def delete_user(self, user, notify_user=False): logging.debug("Deleting user %s %s account" % (user, self.name)) @@ -56,7 +57,8 @@ class MumbleService(ServicesHook): return render_to_string(self.service_ctrl_template, { 'service_name': self.title, 'urls': urls, - 'service_url': self.service_url, + 'service_url': 'mumble://' + self.service_url, + 'connect_url': 'mumble://' + str(request.user.mumble.username + '@' + self.service_url if MumbleTasks.has_account(request.user) else self.service_url), 'username': request.user.mumble.username if MumbleTasks.has_account(request.user) else '', }, request=request) diff --git a/services/modules/mumble/templates/registered/mumble_service_ctrl.html b/services/modules/mumble/templates/registered/mumble_service_ctrl.html new file mode 100644 index 00000000..b668e110 --- /dev/null +++ b/services/modules/mumble/templates/registered/mumble_service_ctrl.html @@ -0,0 +1,25 @@ + + {{ service_name }} + {{ username }} + {{ service_url }} + + {% ifequal username "" %} + + + + {% else %} + + + + + + + + + + + + + {% endifequal %} + + diff --git a/stock/templates/registered/services_ctrl.html b/stock/templates/registered/services_ctrl.html index 272cf101..f34f9a8e 100644 --- a/stock/templates/registered/services_ctrl.html +++ b/stock/templates/registered/services_ctrl.html @@ -7,23 +7,23 @@ {% ifequal username "" %} {% if urls.auth_activate %} - + {% endif %} {% else %} {% if urls.auth_set_password %} - + {% endif %} {% if urls.auth_reset_password %} - + {% endif %} {% if urls.auth_deactivate %} - + {% endif %} From fb22aaf731d99f001491622739f0141bcc506211 Mon Sep 17 00:00:00 2001 From: Adarnof Date: Wed, 8 Mar 2017 17:50:43 -0500 Subject: [PATCH 2/6] Consolidate TS3 into base services table Beautify services table with hover and no borders Unify formatting of mumble/jabber/ts3 service URLs in table --- services/modules/mumble/auth_hooks.py | 4 +-- .../registered/mumble_service_ctrl.html | 4 +-- .../registered/teamspeak3_service_ctrl.html | 25 +++++++------------ stock/templates/registered/services.html | 2 +- 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/services/modules/mumble/auth_hooks.py b/services/modules/mumble/auth_hooks.py index 44f4024d..d2fcf307 100644 --- a/services/modules/mumble/auth_hooks.py +++ b/services/modules/mumble/auth_hooks.py @@ -57,8 +57,8 @@ class MumbleService(ServicesHook): return render_to_string(self.service_ctrl_template, { 'service_name': self.title, 'urls': urls, - 'service_url': 'mumble://' + self.service_url, - 'connect_url': 'mumble://' + str(request.user.mumble.username + '@' + self.service_url if MumbleTasks.has_account(request.user) else self.service_url), + 'service_url': self.service_url, + 'connect_url': request.user.mumble.username + '@' + self.service_url if MumbleTasks.has_account(request.user) else self.service_url, 'username': request.user.mumble.username if MumbleTasks.has_account(request.user) else '', }, request=request) diff --git a/services/modules/mumble/templates/registered/mumble_service_ctrl.html b/services/modules/mumble/templates/registered/mumble_service_ctrl.html index b668e110..e818b7db 100644 --- a/services/modules/mumble/templates/registered/mumble_service_ctrl.html +++ b/services/modules/mumble/templates/registered/mumble_service_ctrl.html @@ -1,7 +1,7 @@ {{ service_name }} {{ username }} - {{ service_url }} + {{ service_url }} {% ifequal username "" %} @@ -17,7 +17,7 @@ - + {% endifequal %} diff --git a/services/modules/teamspeak3/templates/registered/teamspeak3_service_ctrl.html b/services/modules/teamspeak3/templates/registered/teamspeak3_service_ctrl.html index 7ac4840b..775d6bf7 100644 --- a/services/modules/teamspeak3/templates/registered/teamspeak3_service_ctrl.html +++ b/services/modules/teamspeak3/templates/registered/teamspeak3_service_ctrl.html @@ -1,34 +1,27 @@ {% load i18n %} - - {% trans "Service" %} - {% trans "Unique ID" %} - PermissionKey - {% trans "Action" %} - Teamspeak 3 {{ authinfo.teamspeak3_uid }} - {{ authinfo.teamspeak3_perm_key }} + {{ TEAMSPEAK3_PUBLIC_URL }} {% ifequal authinfo.teamspeak3_uid "" %} - + {% else %} - - - - + - + - + + + + {% endifequal %} - \ No newline at end of file + diff --git a/stock/templates/registered/services.html b/stock/templates/registered/services.html index 11c358b3..98137c10 100755 --- a/stock/templates/registered/services.html +++ b/stock/templates/registered/services.html @@ -10,7 +10,7 @@ {% block content %}

{% trans "Available Services" %}

- +
From 250c376abb550ca786fcd451f45bd6297a50785a Mon Sep 17 00:00:00 2001 From: Adarnof Date: Sun, 12 Mar 2017 16:06:14 -0400 Subject: [PATCH 3/6] Correct queuing of name syncs with user pk --- services/modules/discord/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/modules/discord/tasks.py b/services/modules/discord/tasks.py index 0e502d63..4f0ff61c 100644 --- a/services/modules/discord/tasks.py +++ b/services/modules/discord/tasks.py @@ -118,7 +118,7 @@ class DiscordTasks: def update_all_nicknames(): logger.debug("Updating ALL discord nicknames") for discord_user in DiscordUser.objects.exclude(uid__exact=''): - DiscordTasks.update_nickname.delay(discord_user.user.user_id) + DiscordTasks.update_nickname.delay(discord_user.user.pk) @classmethod def disable(cls): From 6c94640552d6603f9c261b1137b33e537c9e5a09 Mon Sep 17 00:00:00 2001 From: Adarnof Date: Sat, 18 Mar 2017 21:30:17 -0400 Subject: [PATCH 4/6] Set main_char_id to emptystring when main deleted Closes #769 --- eveonline/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eveonline/views.py b/eveonline/views.py index ae585464..6a0610a9 100755 --- a/eveonline/views.py +++ b/eveonline/views.py @@ -131,7 +131,7 @@ def api_key_removal(request, api_id): messages.success(request, _('Deleted API key %(apiid)s') % {"apiid": api_id}) logger.info("Succesfully processed api delete request by user %s for api %s" % (request.user, api_id)) if not EveCharacter.objects.filter(character_id=authinfo.main_char_id).exists(): - authinfo.main_char_id = None + authinfo.main_char_id = '' authinfo.save() set_state(request.user) return redirect("auth_dashboard") From 2cd43280e286a026afefef8fd811b60b24afcbc1 Mon Sep 17 00:00:00 2001 From: Basraah Date: Fri, 31 Mar 2017 13:22:43 +1000 Subject: [PATCH 5/6] Remove obsolete services settings --- docs/installation/auth/settings.md | 46 ------------------------------ 1 file changed, 46 deletions(-) diff --git a/docs/installation/auth/settings.md b/docs/installation/auth/settings.md index e7d3eeb6..6d1afdea 100644 --- a/docs/installation/auth/settings.md +++ b/docs/installation/auth/settings.md @@ -215,52 +215,6 @@ If `True`, add members to groups with their alliance name, prefixed with `Allian If `True`, add blues to groups with their corp name, prefixed with `Corp_` ### BLUE_ALLIANCE_GROUPS If `True`, add blues to groups with their alliance name, prefixed with `Alliance_` -## Alliance Service Setup -### ENABLE_AUTH_FORUM -Allow members of the owning corp or alliance to generate accounts on a Phpbb3 install. -### ENABLE_AUTH_JABBER -Allow members of the owning corp or alliance to generate accounts on an Openfire install. -### ENABLE_AUTH_MUMBLE -Allow members of the owning corp or alliance to generate accounts on a Mumble install. -### ENABLE_AUTH_IPBOARD -Allow members of the owning corp or alliance to generate accounts on an IPBoard install. -### ENABLE_AUTH_TEAMSPEAK3 -Allow members of the owning corp or alliance to generate accounts on a Teamspeak3 install. -### ENABLE_AUTH_DISCORD -Allow members of the owning corp or alliance to link accounts to a Discord server. -### ENABLE_AUTH_DISCOURSE -Allow members of the owning corp or alliance to generate accounts on a Discourse install -### ENABLE_AUTH_IPS4 -Allow members of the owning corp or alliance to generate accounts on a IPSuite4 install. -### ENABLE_AUTH_SMF -Allow members of the owning corp or alliance to generate accounts on a SMF install. -### ENABLE_AUTH_MARKET -Allow members of the owning corp or alliance to generate accounts on an alliance market install. -### ENABLE_AUTH_XENFORO -Allow members of the owning corp or alliance to generate accounts on a XenForo install. -## Blue Service Setup -### ENABLE_BLUE_FORUM -Allow blues of the owning corp or alliance to generate accounts on a Phpbb3 install. -### ENABLE_BLUE_JABBER -Allow blues of the owning corp or alliance to generate accounts on an Openfire install. -### ENABLE_BLUE_MUMBLE -Allow blues of the owning corp or alliance to generate accounts on a Mumble install. -### ENABLE_BLUE_IPBOARD -Allow blues of the owning corp or alliance to generate accounts on an IPBoard install. -### ENABLE_BLUE_TEAMSPEAK3 -Allow blues of the owning corp or alliance to generate accounts on a Teamspeak3 install. -### ENABLE_BLUE_DISCORD -Allow blues of the owning corp or alliance to link accounts to a Discord server. -### ENABLE_BLUE_DISCOURSE -Allow blues of the owning corp or alliance to generate accounts on a Discourse install. -### ENABLE_BLUE_IPS4 -Allow blues of the owning corp or alliance to generate accounts on an IPSuite4 install. -### ENABLE_BLUE_SMF -Allow blues of the owning corp or alliance to generate accounts on a SMF install. -### ENABLE_BLUE_MARKET -Allow blues of the owning corp or alliance to generate accounts on an alliance market install. -### ENABLE_BLUE_XENFORO -Allow blues of the owning corp or alliance to generate accounts on a XenForo install. ## Tenant Configuration Characters of any corp or alliance with their ID here will be treated as a member. ### CORP_IDS From 806962cda5ab559bdaecdb70c534f9048e01f70d Mon Sep 17 00:00:00 2001 From: Basraah Date: Sun, 2 Apr 2017 21:50:48 +1000 Subject: [PATCH 6/6] Fix incorrect variable name --- services/signals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/signals.py b/services/signals.py index 69512573..1652316f 100644 --- a/services/signals.py +++ b/services/signals.py @@ -53,7 +53,7 @@ def m2m_changed_user_permissions(sender, instance, action, *args, **kwargs): svc.validate_user(instance) except: logger.exception( - 'Exception running validate_user for services module {} on user {}'.format(svc, user)) + 'Exception running validate_user for services module {} on user {}'.format(svc, instance)) transaction.on_commit(lambda: validate_all_services())
{% trans "Service" %} {% trans "Username" %}