Improve UserGroupAssignmentHandler::checkUsers()
authorMatthias Schmidt <gravatronics@live.com>
Wed, 4 Mar 2015 19:00:10 +0000 (20:00 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 4 Mar 2015 19:00:10 +0000 (20:00 +0100)
wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php

index e57889a0c1ca152882ab098754c40d2b14b2750d..e1754463f003a8dad3a9220c574348c8e7f8db21 100644 (file)
@@ -64,12 +64,14 @@ class UserGroupAssignmentHandler extends SingletonFactory {
                                }
                        }
                        
-                       $userAction = new UserAction(array($user), 'addToGroups', array(
-                               'addDefaultGroups' => false,
-                               'deleteOldGroups' => false,
-                               'groups' => $newGroupIDs
-                       ));
-                       $userAction->executeAction();
+                       if (!empty($newGroupIDs)) {
+                               $userAction = new UserAction(array($user), 'addToGroups', array(
+                                       'addDefaultGroups' => false,
+                                       'deleteOldGroups' => false,
+                                       'groups' => $newGroupIDs
+                               ));
+                               $userAction->executeAction();
+                       }
                }
        }