Updates/overwrites provided fields for the userData.
@param {string} userId
@param {object} userData
@param {function} [callback]
@returns {*}
508397
function updateUser(userId, userData, callback) {
        return collection.findOne({_id: userId, type: {$ne: CONSTANTS.ORGANIZATION}, disabled: {$ne: true}})
            .then(function (oldUserData) {
                if (!oldUserData) {
                    return Q.reject(new Error('no such user [' + userId + ']'));
                }

                oldUserData.email = userData.email || oldUserData.email;


                if (userData.hasOwnProperty('data')) {
                    if (UTIL.isTrueObject(userData.data)) {
                        oldUserData.data = userData.data;
                    } else {
                        throw new Error('supplied userData.data is not an object [' + userData.data + ']');
                    }
                }

                if (userData.hasOwnProperty('settings')) {
                    if (UTIL.isTrueObject(userData.settings)) {
                        oldUserData.settings = userData.settings;
                    } else {
                        throw new Error('supplied userData.settings is not an object [' + userData.settings + ']');
                    }
                }

                if (userData.hasOwnProperty('canCreate')) {
                    oldUserData.canCreate = userData.canCreate === 'true' || userData.canCreate === true;
                }

                if (userData.hasOwnProperty('siteAdmin')) {
                    oldUserData.siteAdmin = userData.siteAdmin === 'true' || userData.siteAdmin === true;
                }

                oldUserData.displayName = userData.displayName || oldUserData.displayName;

                if (userData.password) {
                    return Q.ninvoke(bcrypt, 'hash', userData.password, gmeConfig.authentication.salts)
                        .then(function (hash) {
                            oldUserData.passwordHash = hash;
                            return collection.updateOne({_id: userId}, oldUserData, {upsert: true});
                        });
                } else {
                    return collection.updateOne({_id: userId}, oldUserData, {upsert: true});
                }
            })
            .then(function () {
                return getUser(userId);
            })
            .nodeify(callback);
    }
1033215
function(userId, properties, callback) {
      if (!userId) return callback(new Error(utils.i18n.identities.id));
      utils.debug('Identity edit: ' + userId);

      request.patch({
        path: '/users/' + userId + '/identity',
        body: Object.keys(properties).map(function(propertyName) {
          return {
            operation: 'set',
            property: propertyName,
            value: properties[propertyName]
          };
        })
      }, callback || utils.nop);
    }
981875
def put(self, data, request, id):
        
        if not id:
            # can't update the whole container
            raise errors.MethodNotAllowed()
        userdata = self._dict_to_model(data)
        userdata.pk = id
        try:
            userdata.save(force_update=True)
        except DatabaseError:
            # can't udpate non-existing user
            raise errors.NotFound()
1161383
public Object setUserData(String key, Object data, UserDataHandler handler) {
	// dynamic load to support jre 1.4 and 1.5
	try {
	    Method m = node.getClass().getMethod("setUserData", new Class[] { key.getClass(), data.getClass(), handler.getClass() });
	    return m.invoke(node, new Object[] { key, data, handler });
	}
	catch (Exception e) {
	    throw new PageRuntimeException(Caster.toPageException(e));
	}
    }
886111
function update() {
    var $this = this,
      self = User.resourceConstructor().call(this, this.id);

    return self.update.apply(self, arguments).then(function (updated) {
      Utils.extend($this, updated, true);
      return updated;
    });
  }
1246562
public function update($user_uid, $uid)
    {
        $user = Subbly::api('subbly.user')->find($user_uid);

        if (!Input::has('user_address')) {
            return $this->jsonErrorResponse('"user_address" is required.');
        }

        $userAddress = Subbly::api('subbly.user_address')->update($uid, Input::get('user_address'));

        return $this->jsonResponse(array(
            'user_address' => $userAddress,
        ),
        array(
            'status' => array(
                'code'    => 200,
                'message' => 'UserAddress updated',
            ),
        ));
    }
778013
public static function Walk($callback, $userData = null) {
		self::start ();
		array_walk ( $_SESSION, $callback, $userData );
		return $_SESSION;
	}
263678
function putAuthUser(req, res) {
    var query;
    var update;

    // Check if the user is actually logged in. We should try to update info
    // for an anonymous user.
    if (!(req.user && req.user.data)) {
      res.status(401).send('Not authenticated');

      return;
    }

    // For right now, we do not allow the user to change their username if it
    // has been set before.
    if (req.user.username) {
      res.status(422).send(
        'You cannot change the user name of a registered user.');
      return;
    }

    // Setup and execute an update query.
    query = {
      provider: req.user.data.provider,
      idWithProvider: req.user.data.idWithProvider
    };
    update = {
      username: req.body.username
    };

    providerAccounts.update(query, update).exec()
      .then(function () {

        // Now we need to update user's data in the session. The simplest way
        // to do that is to first get the current user's data.
        return oauth.getUserFromProfile(providerAccounts, req.user.data)
          .then(function (userRecord) {
            if (!userRecord) {
              throw new Error('Could not get user record.');
            }
            // Once we have the userRecord, we try to update the session.
            if (authConfig.maintenance === 'cookie') {
              req.login(userRecord, function (error) {
                if (error) {
                  throw error;
                } else {
                  res.status(200).send(userRecord);
                }
              });
            } else {
              // generate a new token
              var secrets = config.getConfig('secrets');
              var currentToken = req.headers.authorization.replace(
                'Bearer ', '');
              var decodedToken = jwt.decode(currentToken);

              var expiresInMinutes = 60;
              decodedToken.data.username = userRecord.data.username;
              var newToken = generateToken(decodedToken.data,
                expiresInMinutes,
                secrets.authTokenSecret);

              userRecord.meta = userRecord.meta || {};
              userRecord.meta.token = newToken;
              userRecord.meta.expires = getExpirationTime(
                expiresInMinutes);

              log.debug('getNewToken requested with: ', currentToken);
              log.debug('token decoded as :', decodedToken);


              res.status(200).send(userRecord);
            }
          });
      })
      .then(null, util.makeErrorResponder(res));
  }
1354638
def user_field_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/user_fields.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
159679
def user_update(self, username, data):
        
        url = 'rest/api/2/user?username={0}'.format(username)
        return self.put(url, data=data)
975750
function(userId, messageId, callback) {
      if (!userId) return callback(new Error(utils.i18n.messages.userId));
      messageId = utils.toUUID(messageId);
      if (!messageId) return callback(new Error(utils.i18n.messages.mid));
      utils.debug('Message getFromUser: ' + userId + ', ' + messageId);

      request.get({
        path: '/users/' + querystring.escape(userId) + '/messages/' + messageId
      }, callback);
    }
903459
function (data) {
    var user = this$1.onSuccess(data);
    if (isFunction(onSuccess)) {
      onSuccess(user);
    }
    return user
  }
898959
public static function update($userId, $id, $params = null, $options = null)
    {
        return self::_userBasedUpdate($userId, $id, $params, $options);
    }
1203540
void editUserData() {

        if (m_context instanceof CmsEmbeddedDialogContext) {
            ((CmsEmbeddedDialogContext)m_context).closeWindow(true);
        } else {
            A_CmsUI.get().closeWindows();
        }
        CmsUserDataDialog dialog = new CmsUserDataDialog(m_context);
        m_context.start(CmsVaadinUtils.getMessageText(Messages.GUI_USER_EDIT_0), dialog);
    }
340008
function User(data){
    var self = this;
    Object.keys(data).map(function(k){
      self[k] = data[k];
    });
  }
104877
public function update($vals, $userid = null)
	{
		$this->debug->groupCollapsed(__METHOD__);
		$return = array(
			'success'	=> true,
			'errorDesc'	=> '',
		);
		$vals = array_change_key_case($vals);
		$this->debug->log('vals', $vals);
		$vals_auth = array();
		$current_user = true;
		if (isset($userid) && $userid != $this->userid) {
			$current_user = false;
		} else {
			$userid = $this->userid;
		}
		foreach (array('username','password') as $k) {
			if (isset($vals[$k])) {
				$vals_auth[$k] = $vals[$k];
				unset($vals[$k]);
			}
		}
		if (!empty($vals)) {
			$noQuoteCols = array();
			foreach ($vals as $k => $v) {
				if (isset($this->cfg['userForeignKeys'][$k])) {
					$fka = $this->cfg['userForeignKeys'][$k];
					$k_new = $fka['userCol'];
					$v_new = Str::quickTemp('('.$fka['getValQuery'].')', array('value'=>$this->db->quoteValue($v)));
					unset($vals[$k]);
					$vals[$k_new] = $v_new;
					$noQuoteCols[] = $k_new;
				}
			}
			if (!empty($vals['lastactivity']) && preg_match('/\w+\(.*?\)/', $vals['lastactivity'])) {
				$noQuoteCols[] = 'lastactivity';
			}
			$this->debug->log('vals', $vals);
			$result = $this->db->rowMan('user', $vals, array('userid' => $userid), $noQuoteCols);
			if ($result === false) {
				$return['success'] = false;
				$return['errorDesc'] = $this->db->error;
				$this->debug->warn('errors', $this->db->errors);
				$this->debug->warn('error', $this->db->resource->error);
			} elseif ($current_user) {
				unset($vals['lastactivity']);	// we don't want to overwrite the current session's value
				$this->user = array_merge($this->user, $vals);
			}
		}
		if ($return['success'] && !empty($vals_auth)) {
			if (isset($vals_auth['password'])) {
				$vals_auth['password'] = $this->hashPassword($vals_auth['password']);
				$this->log('pwChange', $userid);
			}
			// try update first
			$result = $this->db->rowMan('user_auth', $vals_auth, array('userid' => $userid));
			$this->debug->log('result', $result);
			if ($result === 0) {
				// no rows affected -> try insert
				$vals_auth['userid'] = $userid;
				$result = $this->db->rowMan('user_auth', $vals_auth);
				$this->debug->log('result', $result);
			}
			if ($result === false) {
				$return['success'] = false;
				$return['errorDesc'] = $this->db->error;
			}
		}
		$this->debug->groupEnd();
		return $return;
	}
88787
final public function walk(Callable $callback, $userdata = null)
	{
		array_walk($this->{self::MAGIC_PROPERTY}, $callback);
		return $this;
	}