Allows you to update settings for a given user.
548077
def update_user(self, user, email=None, username=None,
            uid=None, defaultRegion=None, enabled=None):
        
        user_id = utils.get_id(user)
        uri = "users/%s" % user_id
        upd = {"id": user_id}
        if email is not None:
            upd["email"] = email
        if defaultRegion is not None:
            upd["RAX-AUTH:defaultRegion"] = defaultRegion
        if username is not None:
            upd["username"] = username
        if enabled is not None:
            upd["enabled"] = enabled
        data = {"user": upd}
        resp, resp_body = self.method_put(uri, data=data)
        if resp.status_code in (401, 403, 404):
            raise exc.AuthorizationFailure("You are not authorized to update "
                    "users.")
        return User(self, resp_body)
706538
def save(self):
        """"""
        logger.debug("User requested to save settings. New settings: " + self._settings_str())
        cm.ConfigManager.SETTINGS[cm.PROMPT_TO_SAVE] = not self.autosave_checkbox.isChecked()
        cm.ConfigManager.SETTINGS[cm.SHOW_TRAY_ICON] = self.show_tray_checkbox.isChecked()
        # cm.ConfigManager.SETTINGS[cm.MENU_TAKES_FOCUS] = self.allow_kb_nav_checkbox.isChecked()
        cm.ConfigManager.SETTINGS[cm.SORT_BY_USAGE_COUNT] = self.sort_by_usage_checkbox.isChecked()
        cm.ConfigManager.SETTINGS[cm.UNDO_USING_BACKSPACE] = self.enable_undo_checkbox.isChecked()
        cm.ConfigManager.SETTINGS[cm.NOTIFICATION_ICON] = self.system_tray_icon_theme_combobox.currentData(Qt.UserRole)
        # TODO: After saving the notification icon, apply it to the currently running instance.
        self._save_autostart_settings()
618437
def settings_system_update(self, data):
        
        data["auth_password"] = self._password

        response = self._put(url.settings_system, body=data)
        self._check_response(response, 200)
690336
def AuthorizeUser(self, user, subject):
    """"""

    user_set = self.authorized_users.setdefault(subject, set())
    user_set.add(user)
145399
def update_user_settings(self, id, collapse_global_nav=None, manual_mark_as_read=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - id
        """ID"""
        path["id"] = id

        # OPTIONAL - manual_mark_as_read
        """If true, require user to manually mark discussion posts as read (don't
        auto-mark as read)."""
        if manual_mark_as_read is not None:
            params["manual_mark_as_read"] = manual_mark_as_read

        # OPTIONAL - collapse_global_nav
        """If true, the user's page loads with the global navigation collapsed"""
        if collapse_global_nav is not None:
            params["collapse_global_nav"] = collapse_global_nav

        self.logger.debug("GET /api/v1/users/{id}/settings with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/users/{id}/settings".format(**path), data=data, params=params, no_data=True)
1072932
public function updateUserSettingsAction(Request $request)
    {
        /** @var array $settings */
        $settings = $request->get('settings');

        $user = $this->getUser();

        $userSettings = $user->getSettings();

        foreach ($settings as $settingKey => $value) {
            $userSettings[$settingKey] = $value;
        }

        $user->setSettings($userSettings);

        $em = $this->get('doctrine')->getManager();

        $em->persist($user);
        $em->flush();

        return new JsonResponse();
    }
1247434
def users_set_preferences(self, user_id, data, **kwargs):
        """"""
        return self.__call_api_post('users.setPreferences', userId=user_id, data=data, kwargs=kwargs)
1042526
public void updateUser(String userDBID, User user) throws ProvisioningApiException {
		try {
			ApiSuccessResponse resp = usersApi.updateUser(userDBID, new UpdateUserData().data(Converters.convertUserToUpdateUserDataData(user)));

			if (!resp.getStatus().getCode().equals(0)) {
				throw new ProvisioningApiException("Error updating user. Code: " + resp.getStatus().getCode());
			}
        } catch(ApiException e) {
        	throw new ProvisioningApiException("Error updating user", e);
        }
	}
307926
public function update_settings() {
		if ( isset( $_POST['option_page'] ) &&
			'github_updater' === $_POST['option_page']
		) {
			$options = $this->filter_options();
			update_site_option( 'github_updater', $this->sanitize( $options ) );
		}

		/**
		 * Save $options in add-on classes.
		 *
		 * @since 8.0.0
		 */
		do_action( 'github_updater_update_settings', $_POST );

		$this->redirect_on_save();
	}
296583
function updateUserDataField(userId, data, overwrite, callback) {
        return _updateUserObjectField(userId, ['data'], data, overwrite)
            .then(function (userData) {
                return userData.data;
            })
            .nodeify(callback);
    }
68209
async def update(self, fields=''):
    '''
    '''
    path = 'Users/{{UserId}}/Items/{}'.format(self.id)
    info = await self.connector.getJson(path,
                                        remote=False,
                                        Fields='Path,Overview,'+fields
    )
    self.object_dict.update(info)
    self.extras = {}
    return self
1239130
def enable(ctx):
    """"""

    if ctx.obj['username'] is None:
        log('Specify the username with "iso db user --username ..."')
        return

    change_user = ctx.obj['db'].objectmodels['user'].find_one({
        'name': ctx.obj['username']
    })

    change_user.active = True
    change_user.save()
    log('Done')
1127686
public static void updateUserPreferences(CmsObject cms, HttpServletRequest req) {

        HttpSession session = req.getSession(false);
        if (session == null) {
            return;
        }
        CmsWorkplaceSettings settings = (CmsWorkplaceSettings)session.getAttribute(
            CmsWorkplaceManager.SESSION_WORKPLACE_SETTINGS);
        if (settings == null) {
            return;
        }
        // keep old synchronize settings
        CmsSynchronizeSettings synchronizeSettings = settings.getUserSettings().getSynchronizeSettings();
        settings = CmsWorkplace.initWorkplaceSettings(cms, settings, true);
        settings.getUserSettings().setSynchronizeSettings(synchronizeSettings);
    }
1012598
def update(self, settings):
        """"""
        self.settings.cache_clear()
        self._settings = settings
        log.info("Updated settings to %s", self._settings)
        self._update_disabled_plugins()
1336129
def update_user(self, user, username=None, first_name=None, last_name=None):
		""""""
		
		if not isinstance(user, User):
			raise ValueError
		args = locals()
		url = api_url+'users/'+str(user.id)+'/'
		payload = {}
		for i in args:
			if args[i] is not None and i not in ['self', 'user']:
				payload[i] = args[i]
		r = requests.patch(url, data=json.dumps(payload), headers=self.headers)
		print(request_status(r))
		r.raise_for_status()
		return User(r.json())
1079642
def _UpdateUsers(self, update_users):
    
    for user, ssh_keys in update_users.items():
      if not user or user in self.invalid_users:
        continue
      configured_keys = self.user_ssh_keys.get(user, [])
      if set(ssh_keys) != set(configured_keys):
        if not self.utils.UpdateUser(user, ssh_keys):
          self.invalid_users.add(user)
        else:
          self.user_ssh_keys[user] = ssh_keys[:]
346186
def can_update(self, user, **kwargs):
        """"""
        if user.is_admin():
            raise Return((True, set([])))

        is_creator = self.created_by == user.id
        if not (user.is_org_admin(self.organisation_id) or is_creator):
            raise Return((False, set([])))

        fields = ({'service_type', 'organisation_id'} & set(kwargs.keys()))
        if fields:
            raise Return((False, fields))
        else:
            raise Return((True, set([])))