mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: support SSO website and location overrides
Add location and website + the ability to override using SSO using the `sso_overrides_location` and `sso_overrides_website` site settings.
This commit is contained in:
@@ -52,13 +52,19 @@ class UserUpdater
|
||||
|
||||
def update(attributes = {})
|
||||
user_profile = user.user_profile
|
||||
user_profile.location = attributes.fetch(:location) { user_profile.location }
|
||||
user_profile.dismissed_banner_key = attributes[:dismissed_banner_key] if attributes[:dismissed_banner_key].present?
|
||||
user_profile.website = format_url(attributes.fetch(:website) { user_profile.website })
|
||||
unless SiteSetting.enable_sso && SiteSetting.sso_overrides_bio
|
||||
user_profile.bio_raw = attributes.fetch(:bio_raw) { user_profile.bio_raw }
|
||||
end
|
||||
|
||||
unless SiteSetting.enable_sso && SiteSetting.sso_overrides_location
|
||||
user_profile.location = attributes.fetch(:location) { user_profile.location }
|
||||
end
|
||||
|
||||
unless SiteSetting.enable_sso && SiteSetting.sso_overrides_website
|
||||
user_profile.website = format_url(attributes.fetch(:website) { user_profile.website })
|
||||
end
|
||||
|
||||
if attributes[:profile_background_upload_url] == ""
|
||||
user_profile.profile_background_upload_id = nil
|
||||
elsif upload = Upload.get_from_url(attributes[:profile_background_upload_url])
|
||||
|
||||
Reference in New Issue
Block a user