20220922125446_issue4263_saml_display_name.rb 787 B

123456789101112131415161718192021
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue4263SamlDisplayName < ActiveRecord::Migration[6.1]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. saml_setting = Setting.find_by(name: 'auth_saml_credentials')
  7. return if !saml_setting
  8. saml_setting.options[:form].unshift({
  9. display: 'Display name',
  10. null: true,
  11. name: 'display_name',
  12. tag: 'input',
  13. placeholder: 'SAML',
  14. })
  15. saml_setting.save!
  16. end
  17. end