smeserver-ibays/root/etc/e-smith/db/accounts/migrate/20ibay-accounts

19 lines
890 B
Plaintext
Raw Permalink Normal View History

{
foreach my $ibay ($DB->get_all_by_prop(type => 'ibay'))
{
# SME9 introduced SSLRequireSSL with enabled/disabled.
# This replaces local customisation, so migrate 'on' to 'enabled'
$ibay->set_prop ('SSLRequireSSL', 'enabled') if (($ibay->prop ('SSLRequireSSL') || '') eq 'on');
# SME10 merge SSL property (setting to redirect to https) with SSLRequireSSL (setting to force SSL in a directory)
# while they have two different purpose, most admin will want to protect one directory with SSL and ease access to their
# client to gently redirect them to https, hence the merge.
my $SSL = $DB->get_prop_and_delete($ibay->key, 'SSL') || 'disabled';
# if SSL is enabled or SSLRequireSSL is enabled we want the new one enabled
# default remains empty for disabled for the moment
$ibay->set_prop('SSLRequireSSL','enabled') if ($SSL eq 'enabled');
}
}