Add an extra protection to avoid having an empty group created

This commit is contained in:
Renato Botelho 2014-11-13 09:10:44 -02:00
parent bd0bb466f0
commit 340ce958d9
1 changed files with 1 additions and 1 deletions

View File

@ -574,7 +574,7 @@ function local_user_set_groups($user, $new_groups = NULL ) {
/* determine which memberships to add */
foreach ($new_groups as $groupname) {
if (in_array($groupname,$cur_groups))
if ($groupname == '' || in_array($groupname,$cur_groups))
continue;
$group = & $config['system']['group'][$groupindex[$groupname]];
$group['member'][] = $user['uid'];