smeserver-phpvirtualbox/root/etc/e-smith/db/configuration/migrate/phpvirtualbox

30 lines
1.0 KiB
Plaintext

{
my $rec = $DB->get('phpvirtualbox')
|| $DB->new_record('phpvirtualbox', {type => 'configuration'});
# webauth replaced by authType, which can have multiple values
if ($rec->prop('webauth')) {
$rec->set_prop('authType', 'WebAuth');
$rec->del_prop('webauth');
}
if ( -e '/etc/e-smith/db/configuration/defaults/phpvirtualbox/Group' ) {
unlink '/etc/e-smith/db/configuration/defaults/phpvirtualbox/Group';
}
# Group has been replaced with userGroups, which already allowed for multiple groups
if ($rec->prop('Group')) {
$rec->set_prop('userGroups', $rec->prop('Group'));
$rec->del_prop('Group');
}
# User replaced by Users, because it already allows for multiple users
if ($rec->prop('User')) {
$rec->set_prop('Users', $rec->prop('User'));
$rec->del_prop('User');
}
if ( -e '/etc/e-smith/db/configuration/defaults/phpvirtualbox/User' ) {
unlink '/etc/e-smith/db/configuration/defaults/phpvirtualbox/User';
}
}