From 340ce958d9930a678d60292388636420030ad77c Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 13 Nov 2014 09:10:44 -0200 Subject: [PATCH] Add an extra protection to avoid having an empty group created --- etc/inc/auth.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 914b18f5c..8baf89cd6 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -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'];