/**
 * Function to check the number of groups per user
 */
function check_groups_per_user($value)
{
    $groups_per_user = $value['groups_per_user'];
    if (isset($_POST['id']) && intval($groups_per_user) != GroupManager::GROUP_PER_MEMBER_NO_LIMIT && GroupManager::get_current_max_groups_per_user($_POST['id']) > intval($groups_per_user)) {
        return false;
    }
    return true;
}