Adds users to the collection.

@EXT\Route("/{id}/user")
@EXT\Method("PATCH")

@param string  $id
@param string  $class
@param Request $request

@return JsonResponse
175753
public function addUsersAction($id, $class, Request $request)
    {
        $object = $this->find($class, $id);
        $users = $this->decodeIdsString($request, 'Claroline\CoreBundle\Entity\User');
        $this->crud->patch($object, 'user', Crud::COLLECTION_ADD, $users);

        return new JsonResponse(
            $this->serializer->serialize($object)
        );
    }
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');
    }
960065
public function addWorkspacesAction($id, $class, Request $request)
    {
        $object = $this->find($class, $id);
        $workspaces = $this->decodeIdsString($request, 'Claroline\CoreBundle\Entity\Workspace\Workspace');
        $this->crud->patch($object, 'workspace', Crud::COLLECTION_ADD, $workspaces);

        return new JsonResponse(
            $this->serializer->serialize($object)
        );
    }
1236237
public function update(Request $request, $id)
    {
        $abstract = sprintf('themosis.metabox.%s', $id);

        try {
            $metabox = $this->manager->saveFields(app($abstract), $request);
        } catch (\Exception $exception) {
            return response()->json([
                'message' => $exception->getMessage(),
                'errors' => true
            ], 500);
        }

        return response()->json($metabox->toArray());
    }
1261817
public function edit(Request $request, $id)
    {
        $currentUser = $this->getUser();
        $userEntity = $this->getUserEntity($id);
        if ($userEntity === false) {
            return $this->redirectToRoute('users');
        }
        /** @var Permissions $permissions */
        $permissions = $this->app['permissions'];
        $availableRoles = array_flip(array_map(
            function ($role) {
                return $role['label'];
            },
            $permissions->getDefinedRoles()
        ));
        $mutableRoles = $permissions->getManipulatableRoles($currentUser->toArray());

        $formOptions = [
            'password' => [
                'required' => !$userEntity->getId()
            ],
            'roles'    => [
                'choices' => $availableRoles,
                'mutable' => $mutableRoles,
            ],
        ];

        // Generate the form
        $form = $this->createFormBuilder(FormType\UserEditType::class, $userEntity, $formOptions)
            ->getForm()
            ->handleRequest($request)
        ;

        if ($form->isSubmitted() && $form->isValid()) {
            /** @var \Bolt\Form\FormType\UserData $data */
            $data = $form->getData();
            $roleMutator = new ListMutator($availableRoles, $mutableRoles);
            $data->applyToEntity($userEntity, $roleMutator);

            $saved = $this->getRepository(Entity\Users::class)->save($userEntity);
            if ($saved) {
                $this->flashes()->success(Trans::__('page.edit-users.message.user-saved', ['%user%' => $userEntity->getDisplayname()]));
                $this->app['logger.system']->info(
                    Trans::__('page.edit-users.log.user-updated', ['%user%' => $userEntity->getDisplayname()]),
                    ['event' => 'security']
                );
            } else {
                $this->flashes()->error(Trans::__('page.edit-users.message.saving-user', ['%user%' => $userEntity->getDisplayname()]));
            }

            if ($userEntity !== false && $userEntity->getId() === $currentUser->getId() && $userEntity->getUsername() !== $currentUser->getUsername()) {
                // If the current user changed their own login name, the session
                // is effectively invalidated. If so, we must redirect to the
                // login page with a flash message.
                $this->flashes()->error(Trans::__('page.edit-users.message.change-self'));

                return $this->redirectToRoute('login');
            } elseif ($userEntity !== false) {
                // Return to the 'Edit users' screen.
                return $this->redirectToRoute('users');
            }
        }

        $context = [
            'kind'        => $id ? 'edit' : 'create',
            'form'        => $form->createView(),
            'note'        => '',
            'displayname' => $userEntity->getDisplayname(),
        ];

        return $this->render('@bolt/edituser/edituser.twig', $context);
    }
86142
public function putAction(Request $request, $id)
    {
        try {
            $order = $this->getManager()->save(
                $request->request->all(),
                $this->getLocale($request),
                $this->getUser()->getId(),
                $id
            );

            $view = $this->view($order, 200);
        } catch (OrderNotFoundException $exc) {
            $exception = new EntityNotFoundException($exc->getEntityName(), $exc->getId());
            $view = $this->view($exception->toArray(), 404);
        } catch (OrderDependencyNotFoundException $exc) {
            $exception = new EntityNotFoundException($exc->getEntityName(), $exc->getId());
            $view = $this->view($exception->toArray(), 400);
        } catch (MissingOrderAttributeException $exc) {
            $exception = new MissingArgumentException(self::$orderEntityName, $exc->getAttribute());
            $view = $this->view($exception->toArray(), 400);
        } catch (OrderException $exc) {
            $exception = new RestException($exc->getMessage());
            $view = $this->view($exception->toArray(), 400);
        }

        return $this->handleView($view);
    }
986243
public function addAction(Request $request, $id)
    {
        $this->init($request);
        /* @var Node $parentNode */
        $parentNode = $this->em->getRepository('KunstmaanNodeBundle:Node')->find($id);

        // Check with Acl
        $this->denyAccessUnlessGranted(PermissionMap::PERMISSION_EDIT, $parentNode);

        $parentNodeTranslation = $parentNode->getNodeTranslation($this->locale, true);
        $parentNodeVersion = $parentNodeTranslation->getPublicNodeVersion();
        $parentPage = $parentNodeVersion->getRef($this->em);

        $type = $this->validatePageType($request);
        $newPage = $this->createNewPage($request, $type);
        $newPage->setParent($parentPage);

        /* @var Node $nodeNewPage */
        $nodeNewPage = $this->em->getRepository('KunstmaanNodeBundle:Node')
            ->createNodeFor($newPage, $this->locale, $this->user);
        $nodeTranslation = $nodeNewPage->getNodeTranslation(
            $this->locale,
            true
        );
        $weight = $this->em->getRepository('KunstmaanNodeBundle:NodeTranslation')
                ->getMaxChildrenWeight($parentNode, $this->locale) + 1;
        $nodeTranslation->setWeight($weight);

        if ($newPage->isStructureNode()) {
            $nodeTranslation->setSlug('');
        }

        $this->em->persist($nodeTranslation);
        $this->em->flush();

        $this->aclManager->updateNodeAcl($parentNode, $nodeNewPage);

        $nodeVersion = $nodeTranslation->getPublicNodeVersion();

        $this->get('event_dispatcher')->dispatch(
            Events::ADD_NODE,
            new NodeEvent(
                $nodeNewPage, $nodeTranslation, $nodeVersion, $newPage
            )
        );

        return $this->redirect(
            $this->generateUrl(
                'KunstmaanNodeBundle_nodes_edit',
                array('id' => $nodeNewPage->getId())
            )
        );
    }
989203
public function update(Request $request, $id)
    {
        $data = $request->all();

        return $this->processor->update($this, $id, $data);
    }
1218410
public function putAction(Request $request, $id)
    {
        try {
            $this->checkArguments($request);
            $locale = $this->getRequestParameter($request, 'locale', true);
            $user = $this->getUserManager()->save($request->request->all(), $locale, $id);
            $view = $this->view($user, 200);
        } catch (EntityNotFoundException $exc) {
            $view = $this->view($exc->toArray(), 404);
        } catch (UsernameNotUniqueException $exc) {
            $view = $this->view($exc->toArray(), 409);
        } catch (EmailNotUniqueException $exc) {
            $view = $this->view($exc->toArray(), 409);
        } catch (RestException $exc) {
            $view = $this->view($exc->toArray(), 400);
        }

        $this->addSerializationGroups($view);

        return $this->handleView($view);
    }
1008460
public function update(Request $request, $id)
    {
        /** @var \SymfonyId\AdminBundle\Configuration\ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);

        $this->isGrantedOr404Error($crudConfigurator, Constants::ACTION_UPDATE);

        /** @var ModelInterface $model */
        $model = $this->findOr404Error($id);
        $form = $crudConfigurator->getForm($model, 'PUT');

        return $this->save($request, $form, $crudConfigurator);
    }
604221
public function update(int $id, Request $request)
    {
        $attachment = Attachment::findOrFail($id)
            ->fill($request->all());

        $attachment->save();

        return response()->json($attachment);
    }
1363642
public function update($id, UpdateUserRequest $request)
    {
        $this->user->updatewithRoles($request->all(), $request->roles, $id);

        flash(trans('core::messages.resource.resource updated', ['name' => trans('user::users.title.user')]));

        return redirect()->route('backend::user.user.index');
    }
1313525
public function removeGroupsAction($id, $class, Request $request)
    {
        $object = $this->find($class, $id);
        $groups = $this->decodeIdsString($request, 'Claroline\CoreBundle\Entity\Group');
        $this->crud->patch($object, 'group', Crud::COLLECTION_REMOVE, $groups);

        return new JsonResponse($this->serializer->serialize($object));
    }
700611
public function update(Request $request, $id)
    {
        $node = Menu::where('id', $id)->first();

        $this->moveNode($request, $node);
        $this->updateNode($request, $node);

        return $this->response()->item($node, new NodeTransformer());
    }
493853
public function putAction(Request $request, $id)
    {
        try {
            $order = $this->getManager()->save(
                $request->request->all(),
                $this->getLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale')),
                $this->getUser()->getId(),
                $id
            );

            $view = $this->view($order, 200);
        } catch (OrderNotFoundException $exc) {
            $exception = new EntityNotFoundException($exc->getEntityName(), $exc->getId());
            $view = $this->view($exception->toArray(), 404);
        } catch (OrderDependencyNotFoundException $exc) {
            $exception = new EntityNotFoundException($exc->getEntityName(), $exc->getId());
            $view = $this->view($exception->toArray(), 400);
        } catch (MissingOrderAttributeException $exc) {
            $exception = new MissingArgumentException($this->getOrderEntityName(), $exc->getAttribute());
            $view = $this->view($exception->toArray(), 400);
        } catch (OrderException $exc) {
            $exception = new RestException($exc->getMessage());
            $view = $this->view($exception->toArray(), 400);
        }

        return $this->handleView($view);
    }
1209897
public function updateAction(Request $request, $id)
        {

            /** @var Customer $oCustomer */
            $oCustomer = CustomerQuery::create()->findOneById($id);

            if (count($oCustomer) === 0) {
                throw $this->createNotFoundException('Unable to find Customer entity.');
            }

            $deleteForm = $this->createDeleteForm($id);
            $editForm   = $this->createEditForm($oCustomer);
            $editForm->handleRequest($request);


            if ($editForm->isValid()) {


                $sLogoPath = $this->_handleLogoUpload($request, $oCustomer);
                $oCustomer->setLogo($sLogoPath);

                $oCustomer->save();

                return $this->redirect($this->generateUrl('backend_system_customer'));
            }

            return $this->render('SlashworksAppBundle:Customer:edit.html.twig', array(
                'entity'      => $oCustomer,
                'edit_form'   => $editForm->createView(),
                'delete_form' => $deleteForm->createView(),
            ));
        }
20714
public function patchAction($id, Request $request)
    {
        if (!$this->isGranted('IS_AUTHENTICATED_FULLY')) {
            throw new InsufficientAuthenticationException('You must be authenticated to view users');
        }
        $actionFound = false;

        $operations = $request->request->all();

        try {
            (new OperationSyntaxValidator())->validate($operations);
        } catch (InvalidOperationSyntaxException $e) {
            throw new BadRequestHttpException('operation invalid syntax: '.$e->getMessage());
        }

        $entity_patcher = new EntityPatcher(new RightManager($this->getSerializer()->getMetadataFactory()));

        foreach ($operations as $key => $operation) {
            if ('/email' === $operation['path']) {
                $actionFound = $this->patchUserIdentity($id, $operations);
            } elseif ('/groups' === $operation['path']) {
                $actionFound = $this->patchUserGroups($id, $operations);
            } elseif ('/password' === $operation['path']) {
                $actionFound = $this->patchUserPassword($id, $operations);
            } elseif ('/activated' === $operation['path']) {
                $actionFound = $this->patchUserStatus($id, $operations);
            }
        }

        if ($actionFound) {
            return new Response("", 204);
        } else {
            return $this->create404Response('Action not found');
        }
    }