Degrade owner groups during the import
authorAlexander Ebert <ebert@woltlab.com>
Tue, 17 Dec 2019 10:45:37 +0000 (11:45 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 17 Dec 2019 10:45:37 +0000 (11:45 +0100)
wcfsetup/install/files/lib/system/importer/UserGroupImporter.class.php

index 8532dde7bf1a913de9d744ad0ac520160c91e1d0..c6a79eb2313f324c9dd29064ff2e3f6e7bb5b91d 100644 (file)
@@ -26,6 +26,11 @@ class UserGroupImporter extends AbstractImporter {
                        $newGroupID = UserGroup::getGroupByType($data['groupType'])->groupID;
                }
                else {
+                       // Imported owner groups must be degraded, there can be only one owner group.
+                       if ($data['groupType'] == UserGroup::OWNER) {
+                               $data['groupType'] = UserGroup::OTHER;
+                       }
+                       
                        $action = new UserGroupAction([], 'create', [
                                'data' => $data
                        ]);