From e8c982b86ea43f2dc48dc0e98c9443ad9bcdd9c7 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Sat, 12 Aug 2017 13:46:34 +0200 Subject: [PATCH] Fixed assignment to default user groups during user rebuild --- .../lib/data/user/UserProfileAction.class.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php b/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php index 960bc9d7c6..6fc9d8372e 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfileAction.class.php @@ -364,10 +364,19 @@ class UserProfileAction extends UserAction { $fixUserGroupIDs[$user->userID] = [UserGroup::EVERYONE]; $groupIDs[] = UserGroup::EVERYONE; } - if (!in_array(UserGroup::USERS, $groupIDs)) { - if (!isset($fixUserGroupIDs[$user->userID])) $fixUserGroupIDs[$user->userID] = []; - $fixUserGroupIDs[$user->userID][] = UserGroup::USERS; - $groupIDs[] = UserGroup::USERS; + if ($user->activationCode) { + if (!in_array(UserGroup::GUESTS, $groupIDs)) { + if (!isset($fixUserGroupIDs[$user->userID])) $fixUserGroupIDs[$user->userID] = []; + $fixUserGroupIDs[$user->userID][] = UserGroup::GUESTS; + $groupIDs[] = UserGroup::GUESTS; + } + } + else { + if (!in_array(UserGroup::USERS, $groupIDs)) { + if (!isset($fixUserGroupIDs[$user->userID])) $fixUserGroupIDs[$user->userID] = []; + $fixUserGroupIDs[$user->userID][] = UserGroup::USERS; + $groupIDs[] = UserGroup::USERS; + } } $newGroupIDs[$user->userID] = $groupIDs; -- 2.20.1