Security: New config option to disable the use of gravatar for profile images, Closes #1891
This commit is contained in:
@@ -25,6 +25,10 @@ func setIndexViewData(c *middleware.Context) error {
|
||||
IsGrafanaAdmin: c.IsGrafanaAdmin,
|
||||
}
|
||||
|
||||
if setting.DisableGravatar {
|
||||
currentUser.GravatarUrl = setting.AppSubUrl + "/img/user_profile.png"
|
||||
}
|
||||
|
||||
if len(currentUser.Name) == 0 {
|
||||
currentUser.Name = currentUser.Login
|
||||
}
|
||||
|
||||
@@ -71,6 +71,7 @@ var (
|
||||
LogInRememberDays int
|
||||
CookieUserName string
|
||||
CookieRememberName string
|
||||
DisableGravatar bool
|
||||
|
||||
// User settings
|
||||
AllowUserSignUp bool
|
||||
@@ -358,6 +359,8 @@ func NewConfigContext(args *CommandLineArgs) {
|
||||
LogInRememberDays = security.Key("login_remember_days").MustInt()
|
||||
CookieUserName = security.Key("cookie_username").String()
|
||||
CookieRememberName = security.Key("cookie_remember_name").String()
|
||||
DisableGravatar = security.Key("disable_gravatar").MustBool(true)
|
||||
|
||||
// admin
|
||||
AdminUser = security.Key("admin_user").String()
|
||||
AdminPassword = security.Key("admin_password").String()
|
||||
|
||||
Reference in New Issue
Block a user