From 6dcb359379f6faa928fd1e89ac2dbab686fb5255 Mon Sep 17 00:00:00 2001 From: esteele Date: Fri, 11 Sep 2015 11:47:39 -0400 Subject: [PATCH] Migrate login settings to the configuration registry. --- plone/app/upgrade/v50/betas.py | 19 ++++++++++++++++++- .../upgrade/v50/profiles/to_rc2/registry.xml | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/plone/app/upgrade/v50/betas.py b/plone/app/upgrade/v50/betas.py index 969777bc..4f3590f1 100644 --- a/plone/app/upgrade/v50/betas.py +++ b/plone/app/upgrade/v50/betas.py @@ -414,10 +414,27 @@ def to50rc2(context): # Migrate settings from portal_properties to the configuration registry pprop = getToolByName(portal, 'portal_properties') site_properties = pprop['site_properties'] + registry = getUtility(IRegistry) if site_properties.hasProperty('search_results_description_length'): - registry = getUtility(IRegistry) settings = registry.forInterface(ISearchSchema, prefix='plone') value = site_properties.getProperty( 'search_results_description_length', 160) settings.search_results_description_length = value + + properties_to_migrate = ['auth_cookie_length', + 'verify_login_name', + 'external_login_url', + 'external_logout_url', + 'external_login_iframe'] + for p in properties_to_migrate: + if site_properties.hasProperty(p): + value = site_properties.getProperty(p) + registry['plone.%s' % p] = value + site_properties._delProperty(p) + + if site_properties.hasProperty('allow_external_login_sites'): + value = site_properties.get('allow_external_login_sites') + if value is not None: + registry['plone.allow_external_login_sites'] = tuple(value) + site_properties._delProperty('allow_external_login_sites') diff --git a/plone/app/upgrade/v50/profiles/to_rc2/registry.xml b/plone/app/upgrade/v50/profiles/to_rc2/registry.xml index 1b93620b..4f6b0778 100644 --- a/plone/app/upgrade/v50/profiles/to_rc2/registry.xml +++ b/plone/app/upgrade/v50/profiles/to_rc2/registry.xml @@ -4,4 +4,6 @@ prefix="plone" /> + \ No newline at end of file