Commit 3295a4db authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

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.
parents 972e40cc ca192608
...@@ -75,7 +75,7 @@ module ApplicationHelper ...@@ -75,7 +75,7 @@ module ApplicationHelper
else else
gravatar_url = request.ssl? || gitlab_config.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url gravatar_url = request.ssl? || gitlab_config.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
user_email.strip! 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
end end
......
...@@ -117,6 +117,7 @@ production: &base ...@@ -117,6 +117,7 @@ production: &base
## Gravatar ## Gravatar
gravatar: gravatar:
enabled: true # Use user avatar image from Gravatar.com (default: true) 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 # 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 # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment