Project

General

Profile

Actions

Feature #12197

closed

Allow users to set their avatar in Redmine

Added by Daniel Felix about 14 years ago. Updated 16 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Accounts / authentication
Target version:
Resolution:
Fixed

Description

Hey there,

I just tried to upload a userdefined profile picture in our intranet-system.

It seems, that Redmine doesn't support this feature. The only way to integrate it, is to define a gravatar account with my business mailadress, which isn't the best way i think.

My other option is to integrate this Plugin: http://www.redmine.org/plugins/redmine_local_avatars

But this seems fairly outdated. It would be great to have this feature out of the box integrated.

Best regards


Files


Related issues

Related to Redmine - Feature #13536: Other avatar sourcesNewActions
Blocked by Redmine - Defect #44620: Partially written thumbnails may be served during generation or after a failureClosedGo MAEDAActions
Actions #1

Updated by @ go2null over 13 years ago

Feature #13536 asks for LDAP Avatar, in addition to a Local Avatar.

There is also Local Avatars Plugin although it too is for Redmine 1.0.

Actions #2

Updated by Toshi MARUYAMA over 13 years ago

  • Category set to UI
Actions #3

Updated by Anonymous almost 13 years ago

+1

Actions #4

Updated by Yannick SAVANIER almost 13 years ago

+1

Actions #5

Updated by Petr Arbuzov about 7 years ago

+1

Actions #6

Updated by Black Zajaz about 4 years ago

+1

Actions #7

Updated by Go MAEDA 21 days ago

I have attached patches that allow users to upload an image as their avatar. Users without an uploaded avatar continue to be shown with their Gravatar or initials avatar. The feature can be disabled with the new "Allow users to set their avatar" setting on the Display tab, which is enabled by default.

Users change their avatar on the new page /my/avatar, which is linked from the my account page. Administrators can change the avatar of any user on /users/:user_id/avatar, which is linked from the user edit page. This allows administrators to remove an inappropriate image, and to set an image for accounts that never log in. The page shows the current avatar, explains whether it is the uploaded image, the image from the avatar server or the initials, and allows the uploaded image to be replaced, downloaded or deleted.

The image is stored as an attachment whose container is the user, and is referenced by the new users.avatar_id column. Reusing attachments keeps avatars compatible with plugins that store attachments elsewhere, such as in S3, and the column allows avatars to be rendered without additional queries.

Avatars are served only as thumbnails generated by ImageMagick and cropped to a square, so that metadata in the original image, such as the location where a photo was taken, is not exposed. The feature therefore requires ImageMagick. When ImageMagick is not available, uploaded avatars are ignored, Gravatar or initials avatars are displayed instead, and the setting shows a warning:

The original image can be downloaded only by the user and administrators. Like Gravatar and initials avatars, avatars are visible to anyone who can access Redmine, subject to the "Authentication required" setting.

The patches also make the following related changes:

  • The avatar_url attribute in the Users API returns the URL of the uploaded avatar when there is one.
  • CSS rules that targeted img.gravatar now target img.avatar, so that they apply to all avatar images. Themes that target img.gravatar may need to be updated.
  • The avatar in the title of the my account page now links to the new page instead of the avatar server.
  • doc/INSTALL mentions that ImageMagick is required for avatars.

These patches depend on #44620, which prevents partially written thumbnails from being served.

Actions #8

Updated by Go MAEDA 20 days ago

  • Subject changed from Integrate upload for userdefined profile pictures to Allow users to set their avatar in Redmine
Actions #9

Updated by Go MAEDA 20 days ago

I have attached updated patches that replace the patches in #note-7. The only change is the format of the URL of avatar images, which now contains an unguessable hash instead of the attachment id.

In the previous patches, the URL of an avatar contained the user id and the attachment id, for example /users/2/avatar/16. Since both ids are sequential, anyone who can access Redmine could collect avatars by trying ids in turn, including avatars of users who never appear on any page they can see.

The hash in the new URL, for example /users/2/avatar/3f9a1c0b7e2d4a65, is an HMAC of the attachment id with a secret derived from secret_key_base, so the URL cannot be guessed from the ids. An avatar can therefore be retrieved only by those who have seen its URL on a page.

Actions #10

Updated by Go MAEDA 20 days ago

  • Blocked by Defect #44620: Partially written thumbnails may be served during generation or after a failure added
Actions #11

Updated by Go MAEDA 19 days ago

  • Target version changed from Candidate for next major release to 7.1.0

Setting the target version to 7.1.0.

Actions #12

Updated by Go MAEDA 18 days ago

I have attached an updated 0001-Allow-users-to-set-their-avatar-in-Redmine.patch that replaces the one in #note-9. The patch has been rebased onto r25270, in which the deprecated _is_pdf parameter was removed from Redmine::Thumbnail.generate (#44628). The :crop option added by the patch is now the only optional parameter of the method. There are no other changes.

Actions #13

Updated by Go MAEDA 16 days ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patches in r25279, r25280, and r25281 for 7.1.0. Users can now upload an image to use as their avatar.

To change the avatar, open My account and click “Change avatar”. Administrators can also change the avatar of any user from the user's edit page. Users who have not set an avatar continue to see their Gravatar or initials avatar as before.

The feature is enabled by default and can be disabled with the "Allow users to set their avatar" setting in Administration > Settings > Display. It requires ImageMagick, which Redmine already uses to generate thumbnails.

Actions

Also available in: Atom PDF