From 32499e8276c936ddc0a3c951413b6f73cbdae00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Ab=C3=A9lard?= Date: Sat, 11 Jan 2014 09:54:05 +0000 Subject: [PATCH 1/5] allow using the user's email address as a http parameter in gravatar urls for custom avatar systems. For example: plain_url: "http://avatar.company.com/avatar/?mail=%{email}&size=%{size}" --- app/helpers/application_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0db43fa1809..354bdd8e42e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -66,7 +66,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 @@ -221,4 +221,4 @@ module ApplicationHelper def render_markup(file_name, file_content) GitHub::Markup.render(file_name, file_content).html_safe end -end +end \ No newline at end of file From 8419a2a4ebf79631f712f3066b8a9d4594fe9666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Ab=C3=A9lard?= Date: Thu, 10 Apr 2014 14:17:25 +0000 Subject: [PATCH 2/5] add mentions of the different placeholders possible for gravatar urls, mentionning the new %{email} --- config/gitlab.yml.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 2bc984c9294..d5a7c1cadcf 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -108,6 +108,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 @@ -224,4 +225,4 @@ test: new_issue_url: "http://redmine/projects/:issues_tracker_id/issues/new" staging: - <<: *base + <<: *base \ No newline at end of file From 5d7bdf76426488f3229bb1f97aaa54a676cbf166 Mon Sep 17 00:00:00 2001 From: Arnaud ABELARD Date: Sat, 12 Apr 2014 23:10:45 +0200 Subject: [PATCH 3/5] allow using the user's email address as a http parameter in gravatar urls for custom avatar systems. For example: plain_url: "http://avatar.company.com/avatar/?mail=%{email}&size=%{size}" add mention of the different placeholders possible for gravatar urls, mentionning the new %{email} --- app/helpers/application_helper.rb | 2 +- config/gitlab.yml.example | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 f30ef528c9d..11df7a5ff15 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 From e9d4587ff11c8510f01dfa184414f73d75b4550b Mon Sep 17 00:00:00 2001 From: Travis Odom Date: Mon, 21 Apr 2014 15:48:42 +0000 Subject: [PATCH 4/5] Actually use the 'user_filter' configuration option --- config/initializers/devise.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 50669ece7a8..d5cb110e881 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -223,6 +223,7 @@ Devise.setup do |config| method: Gitlab.config.ldap['method'], bind_dn: Gitlab.config.ldap['bind_dn'], password: Gitlab.config.ldap['password'], + filter: Gitlab.config.ldap['user_filter'], name_proc: email_stripping_proc end @@ -244,4 +245,4 @@ Devise.setup do |config| config.omniauth provider['name'].to_sym, *provider_arguments end -end +end \ No newline at end of file From 5a521e56cbdb4fe12af3648dccec9a25938b7c37 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Tue, 22 Apr 2014 18:21:32 +0300 Subject: [PATCH 5/5] Newline between sentence and code block --- doc/integration/omniauth.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/integration/omniauth.md b/doc/integration/omniauth.md index a4491432caf..84a5a8e8c28 100644 --- a/doc/integration/omniauth.md +++ b/doc/integration/omniauth.md @@ -21,6 +21,7 @@ Before configuring individual OmniAuth providers there are a few global settings ``` 2. Find the section dealing with OmniAuth. The section will look similar to the following.
+ ``` ## OmniAuth settings omniauth: @@ -50,6 +51,7 @@ Before configuring individual OmniAuth providers there are a few global settings # app_secret: 'YOUR APP SECRET', # args: { scope: 'user:email' } } ``` + 3. Change `enabled` to `true`. 4. Consider the next two configuration options: `allow_single_sign_on` and `block_auto_created_users`. * `allow_single_sign_on` defaults to `false`. If `false` users must be created manually or they will not be able to