public function remove_user_from_group($user, $groupid) {
        global $DB;
        require_capability('moodle/course:managegroups', $this->context);
        $group = $this->get_group($groupid);
        if (!groups_remove_member_allowed($group, $user)) {
            return false;
        }
        if (!$group) {
            return false;
        }
        return groups_remove_member($group, $user);
    }
public function remove_user_from_group($user, $groupid) {
        global $DB;
        require_capability('moodle/course:managegroups', $this->context);
        $group = $this->get_group($groupid);
        if (!groups_remove_member_allowed($group, $user)) {
            return false;
        }
        if (!$group) {
            return false;
        }
        return groups_remove_member($group, $user);
    }
public function remove_user_from_group ( $ user , $ groupid ) { global $ DB ; require_capability ( 'moodle/course:managegroups' , $ this -> context ) ; $ group = $ this -> get_group ( $ groupid ) ; if ( ! groups_remove_member_allowed ( $ group , $ user ) ) { return false ; } if ( ! $ group ) { return false ; } return groups_remove_member ( $ group , $ user ) ; }
Removes a user from a group

@global moodle_database $DB
@param StdClass $user
@param int $groupid
@return bool
Removes a user from a group