Update a custom group
496489
public function update_custom_group($data){
    global $wpdb;

    //ToDo: falta sanitizar variables
    // podriamos crear un mettodo para hacerlo
    // la funcion podria pasarle como primer parametro los datos y como segundo un array con los campos que se va a sanitizar o si se quiere remplazar espacios por _ o quitar caracteres extraños

    // escape all the strings
    array_walk_recursive($data, array($this, 'escape_data'));

    $sql = $wpdb->prepare(
      "UPDATE ". MF_TABLE_CUSTOM_GROUPS .
      " SET name = %s, label =%s, duplicated = %d, expanded = %d ".
      " WHERE id = %d",
      $data['core']['name'],
      $data['core']['label'],
      $data['core']['duplicate'],
      1,
      $data['core']['id']
    );

    $wpdb->query($sql);
  }
16036
def RenameGroup(r, group, new_name):
    

    body = {
        "new_name": new_name,
    }

    return r.request("put", "/2/groups/%s/rename" % group, content=body)
819240
def update_security_group(self, security_group, body=None):
        """"""
        return self.put(self.security_group_path %
                        security_group, body=body)
1116686
private function adminUpdateGroup()
    {
        $item = $this->dbItem('groups', arg('id', 'int'));

        $item['title'] = arg('title', 'dbsafe');
        $item['description'] = arg('description', 'dbsafe');

        $this->dbUpdate('groups', $item);

        $url = arg('submitURL');
        if (strpos($url, '=group') === false)
        {
            $url .= '&action=group';
        }

        HTTP::redirect($url);
    }
372723
def update_text(self, token, match):
        """"""
        if isinstance(self.text, MatchGroup):
            self.text = self.text.get_group_value(token, match)
769723
public static function update_groups($groups) {
        global $CFG, $DB;
        require_once("$CFG->dirroot/group/lib.php");

        $params = self::validate_parameters(self::update_groups_parameters(), array('groups' => $groups));

        $transaction = $DB->start_delegated_transaction();

        foreach ($params['groups'] as $group) {
            $group = (object)$group;

            if (trim($group->name) == '') {
                throw new invalid_parameter_exception('Invalid group name');
            }

            if (! $currentgroup = $DB->get_record('groups', array('id' => $group->id))) {
                throw new invalid_parameter_exception("Group $group->id does not exist");
            }

            // Check if the modified group name already exists in the course.
            if ($group->name != $currentgroup->name and
                    $DB->get_record('groups', array('courseid' => $currentgroup->courseid, 'name' => $group->name))) {
                throw new invalid_parameter_exception('A different group with the same name already exists in the course');
            }

            $group->courseid = $currentgroup->courseid;

            // Now security checks.
            $context = context_course::instance($group->courseid);
            try {
                self::validate_context($context);
            } catch (Exception $e) {
                $exceptionparam = new stdClass();
                $exceptionparam->message = $e->getMessage();
                $exceptionparam->courseid = $group->courseid;
                throw new moodle_exception('errorcoursecontextnotvalid', 'webservice', '', $exceptionparam);
            }
            require_capability('moodle/course:managegroups', $context);

            if (!empty($group->description)) {
                $group->descriptionformat = external_validate_format($group->descriptionformat);
            }

            groups_update_group($group);
        }

        $transaction->allow_commit();

        return null;
    }
40038
def _UpdateUserGroups(self, user, groups):
    
    groups = ','.join(groups)
    self.logger.debug('Updating user %s with groups %s.', user, groups)
    command = self.usermod_cmd.format(user=user, groups=groups)
    try:
      subprocess.check_call(command.split(' '))
    except subprocess.CalledProcessError as e:
      self.logger.warning('Could not update user %s. %s.', user, str(e))
      return False
    else:
      self.logger.debug('Updated user account %s.', user)
      return True
1295135
def update_resourcegroup(group,**kwargs):
    

    group_i                 = _get_group(group.id)
    group_i.name            = group.name
    group_i.description     = group.description
    group_i.status          = group.status

    db.DBSession.flush()

    return group_i
97636
def update_instance_security_group(self, instance_id,
                                       new_security_group_ids):
        """"""
        ports = port_list(self.request, device_id=instance_id)
        for p in ports:
            params = {'security_groups': new_security_group_ids}
            port_update(self.request, p.id, **params)
1290210
def update
      authorize! :update, @group
      if @group.update(group_params.except(:user_id))
        redirect_to group_path(@group),
                    notice: "Group was successfully updated.",
                    only: true
      else
        render :edit
      end
    end
1029366
public function updateGroup($groupId, Api\GroupUpdate $group)
    {
        $json = Serialize::groupUpdate($group);
        $result = $this->_post($this->_groupUrl($groupId), $json);
        return Deserialize::groupResponse($result);
    }
249996
def update_endpoint_group(self, endpoint_group, body=None):
        """"""
        return self.put(self.endpoint_group_path % endpoint_group, body=body)
135982
def update_dvportgroup(portgroup_ref, spec):
    '''
    
    '''
    pg_name = get_managed_object_name(portgroup_ref)
    log.trace('Updating portgrouo %s', pg_name)
    try:
        task = portgroup_ref.ReconfigureDVPortgroup_Task(spec)
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(
            'Not enough permissions. Required privilege: '
            '{0}'.format(exc.privilegeId))
    except vim.fault.VimFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(exc.msg)
    except vmodl.RuntimeFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareRuntimeError(exc.msg)
    wait_for_task(task, pg_name, six.text_type(task.__class__))
74578
public void updateGroupName(String newGroupName, int id) {
        PreparedStatement statement = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            statement = sqlConnection.prepareStatement(
                "UPDATE " + Constants.DB_TABLE_GROUPS +
                    " SET " + Constants.GROUPS_GROUP_NAME + " = ? " +
                    " WHERE " + Constants.GENERIC_ID + " = ?"
            );
            statement.setString(1, newGroupName);
            statement.setInt(2, id);
            statement.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                if (statement != null) {
                    statement.close();
                }
            } catch (Exception e) {
            }
        }
    }
30660
@Override
    public void updateGroup(ILockableEntityGroup group, boolean renewLock) throws GroupsException {
        throwExceptionIfNotInternallyManaged();

        try {
            if (!group.getLock().isValid()) {
                throw new GroupsException(
                        "Could not update group " + group.getKey() + " has invalid lock.");
            }

            //      updateGroup((IEntityGroup)group);
            getGroupStore().update(group);
            if (cacheInUse()) {
                cacheRemove(group);
            }
            synchronizeGroupMembersOnUpdate(group);

            if (renewLock) {
                group.getLock().renew();
            } else {
                group.getLock().release();
            }

        } catch (LockingException le) {
            throw new GroupsException("Problem updating group " + group.getKey(), le);
        }
    }
995423
def update_group_product(self, group_id, product_data):
        
        product_data['group_id'] = group_id
        return self._post(
            'merchant/group/productmod',
            data=product_data
        )
421428
def change_group(self, name, group):
		
		m1 = OmapiMessage.open(b"host")
		m1.update_object(dict(name=name))
		r1 = self.query_server(m1)
		if r1.opcode != OMAPI_OP_UPDATE:
			raise OmapiError("opening host %s failed" % name)
		m2 = OmapiMessage.update(r1.handle)
		m2.update_object(dict(group=group))
		r2 = self.query_server(m2)
		if r2.opcode != OMAPI_OP_UPDATE:
			raise OmapiError("changing group of host %s to %s failed" % (name, group))