With the current implementation of user avatars, no module can support external avatars without adding custom theme code.

This patch will allow external urls to be set for user->picture but it will be up to modules to set that properly.

Comments

catch’s picture

Category: bug » feature
Status: Active » Needs review

This is a patch, and a feature request.

wim leers’s picture

Status: Needs review » Needs work

An additional space is needed between the comma and "TRUE".

halkeye’s picture

Status: Needs work » Needs review
StatusFileSize
new494 bytes

updated

Anonymous’s picture

Status: Needs review » Needs work

Shouldn't the administrator be given an option to allow external URL for the avatar? I can see this being an issue for some.

catch’s picture

Should definitely be an admin option since this opens up user privacy issues yeah.

halkeye’s picture

I don't see why an admin needs the option for this patch, nor any privacy issues.

All it does is allow modules to set $user->picture to a url instead of only allowing local files, there shouldn't be a way, with drupal core, to set this to a url.

Can someone show me where I'm wrong about this?

Anonymous’s picture

Version: 6.x-dev » 7.x-dev

All it does is allow modules to set $user->picture to a url instead of only allowing local files, there shouldn't be a way, with drupal core, to set this to a url.

I don't know what you're trying to say. User.module is a Drupal core module. Allowing external links for the avatar should be a choice that I (as administrator) need to make. External links could cause issues with the page display. Even if I allow them I may want to temporarily not allow them for network issue reasons. I for one wouldn't allow a user to use external links for the avatar to begin with.

Drupal version 6.x is closed to new features so I've moved the issue to version 7.x.

dave reid’s picture

Issue tags: +user pictures
jeffschuler’s picture

Allowing comment threads and forums to constantly yank many images from many disparate external sources seems like a page-loading nightmare that no admin would really want, particularly because there'd be no straightforward way to limit image size.

However, it could be useful for a user to get their pic from an external location, then be re-sized (as currently, or with imagecache) and stored locally.

It can be annoying as a user to set up a profiles from another machines where you don't have images stored. This is a problem that Gravatar and OpenVatar seek to solve, but they don't solve every user's purpose.

I don't know that this functionality belongs in core, but it might make a nice contrib module.

dave reid’s picture

Assigned: Unassigned » dave reid

This functionality would actually make the job of contrib 'avatar' modules like Gravatar much, much easier. Currently we have to completely override theme_user_picture. In this new case, we could just change $account->picture = 'http://gravatar.com/avatar/md5hashofemail'; and it would work automatically. We don't need to expose an option for this because the only way users can change their pictures is if they upload them, which makes them a local picture. Assigning myself to reroll and write tests.

dave reid’s picture

Category: feature » bug
Status: Needs work » Needs review
StatusFileSize
new723 bytes

Re-rolled for HEAD.

dries’s picture

It seems like this code would probably go away once we Field-ified profile module...

dave reid’s picture

I guess I'm not sure. How exactly would this be replaced by a field?

dave reid’s picture

Plus, user pictures are a part of user.module, not profile.module. :/

kwinters’s picture

Status: Needs review » Needs work

Re: the admin option above - this absolutely has to be disabled by default, and enabled either by turning on a module or enabling a permission / setting.

Arbitrary image URLs are an XSS liability, and we should warn the site admin that this is the case.

dave reid’s picture

Status: Needs work » Needs review

The only way this is going to happen is if a module manually sets $user->picture = 'http://myimage.jpg'. This is not possible to do in the interface at all. There's no option needed, this is just about making contrib easier. It would be presumed that if someone were to install the Gravatar module, they want Gravatars, which are not local images.

kwinters’s picture

Alright, it's reasonable for the interface module to be in charge of permissions / warnings, but the code block in core still needs to say that it is their responsibility and that it is an issue. It's too important to just hope they figure that out, particularly since that kind of security issue is normally handled by core already and they might assume it to be the case here as well.

In the particular case of Gravatars, restricting it to the right domain seems to be sufficient behavior for the module.

MichaelCole’s picture

catch’s picture

Version: 7.x-dev » 8.x-dev
robloach’s picture

Yup, Drupal's User Pictures system hurts my brain.

dave reid’s picture

I'm starting to flip on this that we need to make it easier to grab external images and save them locally, rather than supporting external images. I'm experimenting with this with http://drupal.org/project/user_picture.

moshe weitzman’s picture

robloach’s picture

Status: Needs review » Needs work

I'm starting to flip on this that we need to make it easier to grab external images and save them locally, rather than supporting external images. I'm experimenting with this with http://drupal.org/project/user_picture.

I like this approach more. Hot linking images can result in some very undesired affects, like the host switching out the image with something not so awesome.

I think we might even want to close this one and think about #1292470: Convert user pictures to Image Field instead.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

jhedstrom’s picture

Category: Bug report » Feature request
Issue summary: View changes
Status: Needs work » Postponed (maintainer needs more info)

Is this still needed? Also not sure why it got changed back to a bug.

dpi’s picture

Reasonably sure we don't need this. Since pictures are fields now (#1292470: Convert user pictures to Image Field), and we have https://www.drupal.org/project/avatars as POC on how to load remote images into field.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Moving to outdated since there hasn't been a follow up since moving to PNMI 6
years ago.

If you feel this is still an issue please reopen with an updated issue
summary.