Update a Setting.

@route PUT|PATCH /api/settings
@authentication required
767097
public function update()
    {
        if (!Input::has('settings')) {
            return $this->jsonErrorResponse('"settings" is required.');
        }

        $settings = Subbly::api('subbly.setting');

        $user = $settings->updateMany(Input::get('settings'));

        return $this->jsonResponse(array(
                'settings' => $settings->all(),
            ),
            array(
                'status' => array(
                    'code'    => 200,
                    'message' => 'Settings updated',
                ),
        ));
    }
1306198
public function updateSettings(Request $request)
    {
        $this->authorize('update', Settings::class);

        Settings::first()->update([
            'stripe_key'    => $request->stripe_key ? encrypt($request->stripe_key) : null,
            'stripe_secret' => $request->stripe_secret ? encrypt($request->stripe_secret) : null,
        ]);

        return redirect()->route('laralum::settings.index', ['p' => 'Payments'])->with('success', __('laralum_payments::general.updated_settings'));
    }
992515
public function update($id,Request $request)
    {
        $user_setting = User_setting::findOrfail($id);
    	
        $user_setting->user_id = $request->user_id;
        
        $user_setting->setting_id = $request->setting_id;
        
        $user_setting->notes = $request->notes;
        
        
        $user_setting->save();

        return redirect('user_setting');
    }
415873
def update_settings(self, service_id, version_number, settings={}):
		""""""
		body = urllib.urlencode(settings)
		content = self._fetch("/service/%s/version/%d/settings" % (service_id, version_number), method="PUT", body=body)
		return FastlySettings(self, content)
973546
public function updateAction(Request $request, $id)
    {
        $class_name = $this->container->getParameter('acs_settings.setting_class');
        $settingmanager = $this->get('acs.setting_manager');
        $user_fields = $settingmanager->loadUserFields();
        $em = $this->getDoctrine()->getManager();

        $entity = $this->get('security.context')->getToken()->getUser();

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find ConfigSetting entity.');
        }

        $editForm = $this->createForm(new ConfigSettingCollectionType($user_fields,$em), $entity);

        $editForm->bind($request);


        $postData = $request->request->get('acs_settings_usersettings');

        if ($editForm->isValid()) {
            if (isset($postData['settings'])) {
                    $settings = $postData['settings'];

                    foreach ($settings as $setting) {
                        $args = array(
                            'user' => $entity->getId(),
                            'setting_key' => $setting['setting_key'],
                        );

                        if(isset($setting['service_id'])){
                            $service = $em->getRepository('ACSACSPanelBundle:Service')->find($setting['service_id']);
                            $args['service'] = $service;
                        }

                        $panelsetting = $em->getRepository('ACSACSPanelBundle:PanelSetting')->findOneBy($args);

                        if ($panelsetting && isset($setting['value'])) {
                            $panelsetting->setValue($setting['value']);
                            $em->persist($panelsetting);
                            $em->flush();
                        }
                    }
                    $em->flush();
            }
            return $this->redirect($this->generateUrl('settings'));
        }

        return $this->render('ACSACSPanelSettingsBundle:ConfigSetting:new.html.twig', array(
            'entity' => $entity,
            'form'   => $editForm->createView(),
        ));
    }
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
353812
public function update($key, $value, $group = self::DEFAULT_GROUP) {
        $this->settings[$group][$key] = $value;

        return $this;
    }
983466
def update_params_for_auth!(header_params, query_params, auth_names)
      Array(auth_names).each do |auth_name|
        auth_setting = @config.auth_settings[auth_name]
        next unless auth_setting
        case auth_setting[:in]
        when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
        when 'query'  then query_params[auth_setting[:key]] = auth_setting[:value]
        else fail ArgumentError, 'Authentication token must be in `query` of `header`'
        end
      end
    end
845554
def update(self, settings):
        
        settings = self.clean(settings)

        # Update internal dict
        self._settings.update(settings)

        # Push every setting items as class object attributes
        self.set_settings(settings)

        return self._settings
141334
public function update(Request $request)
    {
        $this->authorize('update', Settings::class);

        $this->validate($request, [
            'appname'     => 'required',
            'description' => 'required',
            'keywords'    => 'required',
            'author'      => 'required',
        ]);

        Settings::first()->update([
            'appname'       => $request->appname,
            'description'   => $request->description,
            'keywords'      => $request->keywords,
            'author'        => $request->author,
        ]);

        return redirect()->route('laralum::settings.index', ['p' => 'Settings'])->with('success', __('laralum_settings::general.updated_settings'));
    }
1293292
def update(self, access_token=None, id_token=None, id_token_jwt=None, userinfo=None):
        

        def set_if_defined(session_key, value):
            if value:
                self._session_storage[session_key] = value

        auth_time = int(time.time())
        if id_token:
            auth_time = id_token.get('auth_time', auth_time)

        self._session_storage['last_authenticated'] = auth_time
        set_if_defined('access_token', access_token)
        set_if_defined('id_token', id_token)
        set_if_defined('id_token_jwt', id_token_jwt)
        set_if_defined('userinfo', userinfo)
1159373
def update(cls, settings):
        """"""
        for key, val in settings.__dict__.items():
            if key.startswith('_'):
                continue
            setattr(cls, key, val)
631559
protected function updateAuthConfig()
    {
        $path = config_path('auth.php');

        file_put_contents($path, str_replace(
            'users', 'SecUsers', file_get_contents($path)
        ));

        file_put_contents($path, str_replace(
            'App\User::class', 'Alfredoem\Ragnarok\SecUsers\SecUser::class', file_get_contents($path)
        ));
    }
731960
private function updateSettings($updates)
    {
        foreach ($updates as $key => $value) {
            $this->model()->where('key', $key)->update(compact('value'));
        }
    }
740124
private static void updateIndexWithSettingsInElasticsearch(RestClient client, String index, String settings) throws Exception {
		logger.trace("updateIndex([{}])", index);

		assert client != null;
		assert index != null;


		if (settings != null) {
			logger.trace("Found update settings for index [{}]: [{}]", index, settings);
			logger.debug("updating settings for index [{}]", index);
            Request request = new Request("PUT", "/" + index + "/_settings");
            request.setJsonEntity(settings);
			client.performRequest(request);
		}

		logger.trace("/updateIndex([{}])", index);
	}
1366003
def update
      if @user.update_attributes(permitted_params.user.merge({:password_required => false}))
        redirect_to edit_user_url(@user), :notice => t(:your_changes_were_saved)
      else
        render :action => 'edit'
      end
    end
551386
public function update(AccountSettingsRequest $request)
    {
        $data = $request->validated();
        $currentUser = $request->user($this->getGuard());

        ! $request->hasFile('profile_picture')
        || $currentUser->addMediaFromRequest('profile_picture')
                       ->sanitizingFileName(function ($fileName) {
                           return md5($fileName).'.'.pathinfo($fileName, PATHINFO_EXTENSION);
                       })
                       ->toMediaCollection('profile_picture', config('cortex.auth.media.disk'));

        ! $request->hasFile('cover_photo')
        || $currentUser->addMediaFromRequest('cover_photo')
                       ->sanitizingFileName(function ($fileName) {
                           return md5($fileName).'.'.pathinfo($fileName, PATHINFO_EXTENSION);
                       })
                       ->toMediaCollection('cover_photo', config('cortex.auth.media.disk'));

        // Update profile
        $currentUser->fill($data)->save();

        return intend([
            'back' => true,
            'with' => ['success' => trans('cortex/auth::messages.account.updated_account')]
                      + (isset($data['two_factor']) ? ['warning' => trans('cortex/auth::messages.verification.twofactor.phone.auto_disabled')] : []),
        ]);
    }