Project

General

Profile

Actions

Feature #42623

open

Adds initials to the list of default gratavar options

Added by Marius BĂLTEANU 6 days ago. Updated 19 minutes ago.

Status:
New
Priority:
Normal
Category:
UI
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Gravatar launched this year initials as default avatar option:

The attached patch adds this to the list of available options.


Files


Related issues

Related to Redmine - Feature #29824: Add user initials when Gravatar is disabledNewMarius BĂLTEANU

Actions
Actions #1

Updated by Marius BĂLTEANU 6 days ago

  • Related to Feature #29824: Add user initials when Gravatar is disabled added
Actions #2

Updated by Marius BĂLTEANU 6 days ago

Two points to clarify:
1. I'm aware about the privacy discussions from #29824, but being an option that must be configured manually from the administration, I think it is safe.
2. The patch was inspired by the patch added by Felix in the #29824, but I think it is better to use the display name to generate the initials.

Go MAEDA, what do you think?

Actions #3

Updated by Go MAEDA 6 days ago

Marius BĂLTEANU wrote in #note-2:

1. I'm aware about the privacy discussions from #29824, but being an option that must be configured manually from the administration, I think it is safe.

I agree, but I think we should display a warning such as the following below the "Default Gravatar image" setting:

When "Initials" is selected, users' names will be sent to https://www.gravatar.com while displaying user icons." 

2. The patch was inspired by the patch added by Felix in the #29824, but I think it is better to use the display name to generate the initials.

I think so too for the following reasons:

  • User names are not always displayed with the firstname lastname order. Redmine also supports the "lastname firstname". It is easy to generate initials with the order if the display name (User#name) is used.
  • Always displaying the first letters of first and last name may cause a privacy problem. For example, when user names are displayed in the #{login} style on Redmine, the current implementation reveals two characters of user names that are not visible for non-admin users.

To address the above, I suggest the following implementation.

  def initials
    name_part1, name_part2 = name.split
    if name_part2.present?
      name_part1.first + name_part2.first
    else
      name_part1.first(2)
    end
  end
Actions #4

Updated by Marius BĂLTEANU 1 day ago

Go MAEDA wrote in #note-3:

[...]

I agree, but I think we should display a warning such as the following below the "Default Gravatar image" setting:

 When "Initials" is selected, users' names will be sent to https://www.gravatar.com while displaying user icons.

In most of the cases, the message is not really correct because we send only the initials to the Gratavar service. Indeed, there are some cases where initials can be the same with the name.

What to you think about a generic message?

Users' email addresses and initials (when selected) are sent to https://www.gravatar.com to generate their avatars.

[...]

I think so too for the following reasons:

  • User names are not always displayed with the firstname lastname order. Redmine also supports the "lastname firstname". It is easy to generate initials with the order if the display name (User#name) is used.
  • Always displaying the first letters of first and last name may cause a privacy problem. For example, when user names are displayed in the #{login} style on Redmine, the current implementation reveals two characters of user names that are not visible for non-admin users.

To address the above, I suggest the following implementation.

[...]

I've changed the implementation to generate the initials based on the user display format in order to be more consistent. Please let me know if this works better for you.

I'm assigning this to 6.1.0 to discuss it.

Actions #5

Updated by Go MAEDA about 14 hours ago

Thank you for updating the patch.

Marius BĂLTEANU wrote in #note-4:

In most of the cases, the message is not really correct because we send only the initials to the Gratavar service. Indeed, there are some cases where initials can be the same with the name.

What to you think about a generic message?

Users' email addresses and initials (when selected) are sent to https://www.gravatar.com to generate their avatars.

Since email addresses are hashed with SHA256 before being sent, it does not cause a privacy issue. A privacy issue only happens when "Initials" is selected, so I think the message should focus on the fact that initials are being sent. I prefer a message like the following:

When "Initials" is selected, users' initials are sent to https://www.gravatar.com to generate their avatars.

I've changed the implementation to generate the initials based on the user display format in order to be more consistent. Please let me know if this works better for you.

The implementation is more sophisticated than the code I suggested in #note-3. However, it needs a slight fix. The value of :initials for :lastname_firstname should be '#{lastname.to_s.first}#{firstname.to_s.first}' (remove the space between the two characters).

Actions #6

Updated by Marius BĂLTEANU 19 minutes ago

  • Assignee set to Marius BĂLTEANU

Go MAEDA wrote in #note-5:

Since email addresses are hashed with SHA256 before being sent, it does not cause a privacy issue. A privacy issue only happens when "Initials" is selected, so I think the message should focus on the fact that initials are being sent. I prefer a message like the following:

[...]

I'm sorry, I totally forgot about the hashing. In this case, I fully agree with you about the message.

I've changed the implementation to generate the initials based on the user display format in order to be more consistent. Please let me know if this works better for you.

The implementation is more sophisticated than the code I suggested in #note-3. However, it needs a slight fix. The value of :initials for :lastname_firstname should be '#{lastname.to_s.first}#{firstname.to_s.first}' (remove the space between the two characters).

Thanks for pointing this out, I will update the patch accordingly.

Actions

Also available in: Atom PDF