Project

General

Profile

Feature #9112 » avatar_service_url_configuration.patch

Go MAEDA, 2019-05-02 14:50

View differences:

config/configuration.yml.example
209 209
  # allowed values: :memory, :file, :memcache
210 210
  #openid_authentication_store: :memory
211 211

  
212
  # URL of the avatar service
213
  #
214
  # By default, Redmine uses Gravatar as the avatar service for displaying
215
  # the user's icon. You can swich to another Gravatar-compatible service
216
  # such as Libravatar.
217
  #
218
  # Examples:
219
  # avatar_service_url: https://www.gravatar.com
220
  # avatar_service_url: https://seccdn.libravatar.org
221
  avatar_service_url:
222

  
212 223
# specific configuration options for production environment
213 224
# that overrides the default ones
214 225
production:
lib/plugins/gravatar/lib/gravatar.rb
39 39
    :ssl => false,
40 40
  }
41 41

  
42
  AVATAR_SERVICE_URL = Redmine::Configuration['avatar_service_url'] || 'https://www.gravatar.com'
43

  
42 44
  # The methods that will be made available to your views.
43 45
  module PublicMethods
44 46

  
......
63 65

  
64 66
    # Returns the base Gravatar URL for the given email hash
65 67
    def gravatar_api_url(hash)
66
      'https://www.gravatar.com/avatar/' + hash.to_s
68
      +"#{AVATAR_SERVICE_URL}/avatar/#{hash}"
67 69
    end
68 70

  
69 71
    # Return the gravatar URL for the given email address.
(1-1/5)