Vergleich inc/functions.php - 1.8.23 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 5103Zeile 5103
	}

// Build the new list of additional groups for this user and make sure they're in the right format

	}

// Build the new list of additional groups for this user and make sure they're in the right format

	$usergroups = "";
$usergroups = $user['additionalgroups'].",".$joingroup;
$groupslist = "";
$groups = explode(",", $usergroups);

	$groups = array_map(
'intval',
explode(',', $user['additionalgroups'])
);





	if(is_array($groups))

	if(!in_array((int)$joingroup, $groups))

	{

	{

		$comma = '';
foreach($groups as $gid)
{
if(trim($gid) != "" && $gid != $user['usergroup'] && !isset($donegroup[$gid]))
{
$groupslist .= $comma.$gid;
$comma = ",";
$donegroup[$gid] = 1;
}
}
}

		$groups[] = (int)$joingroup;
$groups = array_diff($groups, array($user['usergroup']));
$groups = array_unique($groups);

$groupslist = implode(',', $groups);











	// What's the point in updating if they're the same?
if($groupslist != $user['additionalgroups'])
{

 
		$db->update_query("users", array('additionalgroups' => $groupslist), "uid='".(int)$uid."'");
return true;
}
else

		$db->update_query("users", array('additionalgroups' => $groupslist), "uid='".(int)$uid."'");
return true;
}
else

	{
return false;

	{
return false;

	}
}

	}
}





/**
* Remove a user from a specific additional user group
*

/**
* Remove a user from a specific additional user group
*

Zeile 5151Zeile 5142
		return false;
}


		return false;
}


	$groupslist = $comma = '';
$usergroups = $user['additionalgroups'].",";
$donegroup = array();




	$groups = array_map(
'intval',
explode(',', $user['additionalgroups'])
);
$groups = array_diff($groups, array($leavegroup));
$groups = array_unique($groups);





	$groups = explode(",", $user['additionalgroups']);

if(is_array($groups))
{
foreach($groups as $gid)
{
if(trim($gid) != "" && $leavegroup != $gid && empty($donegroup[$gid]))
{
$groupslist .= $comma.$gid;
$comma = ",";
$donegroup[$gid] = 1;
}
}
}

	$groupslist = implode(',', $groups);















$dispupdate = "";
if($leavegroup == $user['displaygroup'])


$dispupdate = "";
if($leavegroup == $user['displaygroup'])