2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2019-02-20 17:09:03 +00:00
|
|
|
# ATTENTION: This migration is most likely not required anymore
|
|
|
|
# because the encoding error was fixed by using a newer version of the psych gem (3.1.0).
|
|
|
|
# However, we'll keep it as a regression test.
|
2018-09-11 09:21:09 +00:00
|
|
|
class Issue2140ResetLdapConfig < ActiveRecord::Migration[5.1]
|
|
|
|
def up
|
|
|
|
# return if it's a new setup
|
2020-08-03 08:35:43 +00:00
|
|
|
return if !Setting.exists?(name: 'system_init_done')
|
2018-09-11 09:21:09 +00:00
|
|
|
|
|
|
|
ldap_config = Setting.get('ldap_config')
|
|
|
|
|
|
|
|
# finish if LDAP config isn't broken
|
|
|
|
ldap_config.to_json
|
|
|
|
rescue Encoding::UndefinedConversionError
|
|
|
|
ldap_config[:wizardData].delete(:backend_user_attributes)
|
|
|
|
|
|
|
|
Setting.set('ldap_config', ldap_config)
|
|
|
|
end
|
|
|
|
end
|