Project

General

Profile

Feature #9112 » avatar_service_url_configuration.patch

Go MAEDA, 2019-05-02 14:50

View differences:

config/configuration.yml.example
# allowed values: :memory, :file, :memcache
#openid_authentication_store: :memory
# URL of the avatar service
#
# By default, Redmine uses Gravatar as the avatar service for displaying
# the user's icon. You can swich to another Gravatar-compatible service
# such as Libravatar.
#
# Examples:
# avatar_service_url: https://www.gravatar.com
# avatar_service_url: https://seccdn.libravatar.org
avatar_service_url:
# specific configuration options for production environment
# that overrides the default ones
production:
lib/plugins/gravatar/lib/gravatar.rb
:ssl => false,
}
AVATAR_SERVICE_URL = Redmine::Configuration['avatar_service_url'] || 'https://www.gravatar.com'
# The methods that will be made available to your views.
module PublicMethods
......
# Returns the base Gravatar URL for the given email hash
def gravatar_api_url(hash)
'https://www.gravatar.com/avatar/' + hash.to_s
+"#{AVATAR_SERVICE_URL}/avatar/#{hash}"
end
# Return the gravatar URL for the given email address.
(1-1/5)