Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

custom icon

Oliver Güntherebab8e40f9c9
diff --git a/modules/auth_saml/app/forms/saml/providers/configuration_form.rb b/modules/auth_saml/app/forms/saml/providers/configuration_form.rb
index da39f5cb98b..3c09a776334 100644
--- a/modules/auth_saml/app/forms/saml/providers/configuration_form.rb
+++ b/modules/auth_saml/app/forms/saml/providers/configuration_form.rb
@@ -76,6 +76,13 @@ module Saml
required: false,
input_width: :large
)
+ f.text_field(
+ name: :icon,
+ label: I18n.t("activemodel.attributes.saml/provider.icon"),
+ caption: I18n.t("saml.instructions.icon"),
+ required: false,
+ input_width: :large
+ )
end
end
end
diff --git a/modules/auth_saml/app/models/saml/provider.rb b/modules/auth_saml/app/models/saml/provider.rb
index f8df2e39bec..e3840842ce9 100644
--- a/modules/auth_saml/app/models/saml/provider.rb
+++ b/modules/auth_saml/app/models/saml/provider.rb
@@ -2,6 +2,7 @@ module Saml
class Provider < AuthProvider
include HashBuilder
+ store_attribute :options, :icon, :string
store_attribute :options, :sp_entity_id, :string
store_attribute :options, :name_identifier_format, :string
store_attribute :options, :metadata_url, :string
diff --git a/modules/auth_saml/app/models/saml/provider/hash_builder.rb b/modules/auth_saml/app/models/saml/provider/hash_builder.rb
index 68954119e0b..33fb17e7ef3 100644
--- a/modules/auth_saml/app/models/saml/provider/hash_builder.rb
+++ b/modules/auth_saml/app/models/saml/provider/hash_builder.rb
@@ -57,6 +57,7 @@ module Saml
{
name: slug,
display_name:,
+ icon:,
assertion_consumer_service_url:,
sp_entity_id:,
idp_sso_service_url:,
diff --git a/modules/auth_saml/app/services/saml/providers/set_attributes_service.rb b/modules/auth_saml/app/services/saml/providers/set_attributes_service.rb
index ca4246af7bf..0da8fa8b962 100644
--- a/modules/auth_saml/app/services/saml/providers/set_attributes_service.rb
+++ b/modules/auth_saml/app/services/saml/providers/set_attributes_service.rb
@@ -82,7 +82,7 @@ module Saml
end
def set_default_creator
- model.creator = user
+ model.creator ||= user
end
def update_idp_cert(cert)
diff --git a/modules/auth_saml/config/locales/en.yml b/modules/auth_saml/config/locales/en.yml
index 4db7d521758..55a8eaa7153 100644
--- a/modules/auth_saml/config/locales/en.yml
+++ b/modules/auth_saml/config/locales/en.yml
@@ -21,6 +21,7 @@ en:
signature_method: Signature algorithm
digest_method: Digest algorithm
format: "Format"
+ icon: "Custom icon"
activerecord:
errors:
models:
@@ -147,3 +148,5 @@ en:
Select the signature algorithm to use for the SAML request signature performed by OpenProject (Default: %{default_option}).
digest_method: >
Select the digest algorithm to use for the SAML request signature performed by OpenProject (Default: %{default_option}).
+ icon: >
+ Optionally provide a public URL to an icon graphic that will be displayed next to the provider name.