diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-23 08:52:15 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-23 08:52:15 +0000 |
commit | 3295a4db9dc417f368720f7fe9724ec8bee0ddcd (patch) | |
tree | ac96ae50c4171bc121b44971920b43b7f0601e39 | |
parent | 972e40cc47b267503059ab1ebb55264596de9271 (diff) | |
parent | ca19260812c60ece623265afa23429f8f1bdbedb (diff) | |
download | gitlab-ce-3295a4db9dc417f368720f7fe9724ec8bee0ddcd.tar.gz |
Merge branch 'email_in_gravatar_urls' into 'master'
allow passing user's email address in custom Gravatar urls
Some custom avatar systems use the user's email address rather than its hash. This merge request will allow the administrator to configure gitlab-ce to use the user's email address gravatar.plain_url and gravatar.ssl_url in the config file like this:
```
gravatar:
enabled: true
plain_url: "http://company.com/avatar/?mail=%{email}&size=%{size}"
ssl_url: "https://company.com/avatar/?mail=%{email}&size=%{size}"
```
It's a only a 2 word patch.
-rw-r--r-- | app/helpers/application_helper.rb | 2 | ||||
-rw-r--r-- | config/gitlab.yml.example | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index faecde299c1..5f07cdf448c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -75,7 +75,7 @@ module ApplicationHelper else gravatar_url = request.ssl? || gitlab_config.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url user_email.strip! - sprintf gravatar_url, hash: Digest::MD5.hexdigest(user_email.downcase), size: size + sprintf gravatar_url, hash: Digest::MD5.hexdigest(user_email.downcase), size: size, email: user_email end end diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 64fc02fe8c2..a266810dc45 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -117,6 +117,7 @@ production: &base ## Gravatar gravatar: enabled: true # Use user avatar image from Gravatar.com (default: true) + # gravatar urls: possible placeholders: %{hash} %{size} %{email} # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm |