You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2022/06/08 18:32:59 UTC

[allura] branch db/8438 created (now 028d86bcf)

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a change to branch db/8438
in repository https://gitbox.apache.org/repos/asf/allura.git


      at 028d86bcf [#8438] better titles on some user-profile project admin pages

This branch includes the following new commits:

     new 6219bfa63 [#8438] option to disable gravatar usage
     new 028d86bcf [#8438] better titles on some user-profile project admin pages

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[allura] 02/02: [#8438] better titles on some user-profile project admin pages

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8438
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 028d86bcfe8983892220646bfa22347662d9839e
Author: Dave Brondsema <db...@slashdotmedia.com>
AuthorDate: Wed Jun 8 14:32:45 2022 -0400

    [#8438] better titles on some user-profile project admin pages
---
 Allura/allura/ext/admin/templates/project_admin.html    | 2 +-
 Allura/allura/ext/admin/templates/project_overview.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Allura/allura/ext/admin/templates/project_admin.html b/Allura/allura/ext/admin/templates/project_admin.html
index e3cf0ba87..3633fc883 100644
--- a/Allura/allura/ext/admin/templates/project_admin.html
+++ b/Allura/allura/ext/admin/templates/project_admin.html
@@ -23,7 +23,7 @@
 
 {% block title %}{{c.project.name}} / Admin Welcome{% endblock %}
 
-{% block header %}Welcome to your {{config.site_name}} project!<span class="title-end"></span>{% endblock %}
+{% block header %}Welcome to your {{config.site_name}} {% if c.project.is_user_project %}user-profile{% endif %} project!<span class="title-end"></span>{% endblock %}
 
 {% set tour = {
     "id": "admin-welcome",
diff --git a/Allura/allura/ext/admin/templates/project_overview.html b/Allura/allura/ext/admin/templates/project_overview.html
index d47744ec4..de6e51569 100644
--- a/Allura/allura/ext/admin/templates/project_overview.html
+++ b/Allura/allura/ext/admin/templates/project_overview.html
@@ -21,7 +21,7 @@
 
 {% block title %}{{c.project.name}} / Metadata{% endblock %}
 
-{% block header %}Project Admin{% endblock %}
+{% block header %}{% if c.project.is_user_project %}Profile Metadata{% else %}Project Admin{% endif %}{% endblock %}
 
 {% block content %}
   {% if c.project.deleted %}


[allura] 01/02: [#8438] option to disable gravatar usage

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8438
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 6219bfa633a00b84415c609fc58ab6aab5b11cde
Author: Dave Brondsema <db...@slashdotmedia.com>
AuthorDate: Wed Jun 8 14:32:32 2022 -0400

    [#8438] option to disable gravatar usage
---
 Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html    | 2 +-
 Allura/allura/model/auth.py                                            | 2 +-
 .../allura/ext/admin/templates/admin_widgets/metadata_admin.html       | 2 +-
 Allura/allura/tests/functional/test_user_profile.py                    | 1 +
 Allura/development.ini                                                 | 3 +++
 5 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
index 1bdcb50f5..3998c4251 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -116,7 +116,7 @@
         <div class="viewer">
           No {% if c.project.is_user_project %}user{% endif %} icon.
           {{ g.icons['edit'].render(id='edit-icon', title='Upload one', show_title=True) }}
-        {% if c.project.is_user_project %}<br><small>
+        {% if c.project.is_user_project and h.asbool(tg.config.get('use_gravatar')) %}<br><small>
             Or a  <a href="http://gravatar.com/">gravatar.com</a> image will be used if available.</small>{% endif %}
         </div>
       {% endif %}
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index 3dda3bad0..5be5ee9aa 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -641,7 +641,7 @@ class User(MappedClass, ActivityNode, ActivityObject, SearchIndexable):
         if private_project and private_project.icon:
             icon_url = config.get('static.icon_base', '') + self.url() + 'user_icon'
             icon_source = 'local'
-        elif self.preferences.email_address:
+        elif self.preferences.email_address and h.asbool(config.get('use_gravatar')):
             gravatar_args = {}
             if gravatar_default_url:
                 gravatar_args['d'] = gravatar_default_url
diff --git a/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html
index f9c4126f8..b47b0cce3 100644
--- a/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/templates_responsive/override/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -123,7 +123,7 @@
         <div class="viewer">
           No {% if c.project.is_user_project %}user{% endif %} icon.
           {{ g.icons['edit'].render(id='edit-icon', title='Upload one', show_title=True) }}
-        {% if c.project.is_user_project %}<br><small>
+        {% if c.project.is_user_project and h.asbool(tg.config.get('use_gravatar')) %}<br><small>
             Or a  <a href="http://gravatar.com/">gravatar.com</a> image will be used if available.</small>{% endif %}
         </div>
       {% endif %}
diff --git a/Allura/allura/tests/functional/test_user_profile.py b/Allura/allura/tests/functional/test_user_profile.py
index cd4b3da7f..d8f6724c1 100644
--- a/Allura/allura/tests/functional/test_user_profile.py
+++ b/Allura/allura/tests/functional/test_user_profile.py
@@ -44,6 +44,7 @@ class TestUserProfile(TestController):
         assert_in('No skills entered', r.html.find(None, 'skills').getText())
 
     @td.with_user_project('test-admin')
+    @mock.patch.dict(tg.config, {'use_gravatar': 'true'})
     def test_profile_user_card(self):
         user = User.by_username('test-admin')
         locals =  {
diff --git a/Allura/development.ini b/Allura/development.ini
index 6bbfb8458..f53b9aa75 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -146,6 +146,9 @@ project_icon_sizes = 16 24 32 48 64 72 90 96 128 135 180 270
 ; To use a custom image for default user profile avatars, specify a full URL here.  Size 96x96 is best, 48x48 ok
 ;default_avatar_image =
 
+; Disabled by default for security/privacy reasons.  If enabled, md5 of email addresses will be used publicly to try to load gravatar images
+;use_gravatar = true
+
 ; For LDAP see https://forge-allura.apache.org/docs/getting_started/installation.html#using-ldap
 ;auth.method = ldap
 auth.method = local