def gl_get_projects(gl, config):
    """Return a list of all the projects.

    This function looks at the config and returns all the projects of a user if
    `user` is specified and all the projects of a group if `group` is specified
    in the config.

    :param gl: An instance of Gitlab's API.
    :type gl: :class:`gitlab.Gitlab`
    :param config: Configuration for Gitlab from config gile.
    :type config: dict
    """
    projects = []
    if 'group' in config:
        for group_name in config['group'].split():
            group = gl.groups.get(group_name)
            projects.extend(group.projects.list())
    if 'user' in config:
        for username in config['user'].split():
            user = gl.users.list(username=username)[0]
            projects.extend(user.projects.list())
    return projects