Creates a form to edit a User entity.

@param User $user The entity

@return \Symfony\Component\Form\Form The form
430438
private function createEditForm(User $user)
    {
        $form = $this->createForm(new UserType(), $user, array(
            'action' => $this->generateUrl('admin_user_update', array('id' => $user->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
458717
public function update(UpdateUserRequest $request, User $user)
    {
        $this->authorize(UsersPolicy::PERMISSION_UPDATE);

        $user->update($request->getValidatedData());
        $user->roles()->sync($request->get('roles'));

        $this->transNotification('updated', ['name' => $user->full_name], $user->toArray());

        return redirect()->route('admin::auth.users.show', [$user->hashed_id]);
    }
27351
protected function FormUrl(User $user = null)
    {
        $args = array();
        if ($user)
        {
            $args['user'] = $user->GetID();
        }
        return BackendRouter::ModuleUrl(new UserForm(), $args); 
    }
1068672
public function addUser(User $user)
    {
        if (!$this->users->contains($user)) {
            $this->users->add($user);
        }

        return $this;
    }
499542
protected function extendForm(User $user, FormBuilder $form)
    {
        $areaProviders = $this->twoFactorProviderService->getAreaProvidersCollection();
        $items         = $this->usersPresenter->index($user, $areaProviders);

        if (empty($items)) {
            return;
        }

        $form->extend(function(FormGrid $form) use($items) {
            $fieldsetName = trans('antares/two_factor_auth::configuration.index');

            $form->findFieldsetOrCreateNew($fieldsetName, function(Fieldset $fieldset) use($items) {

                foreach ($items as $item) {
                    $fieldset->control('input:text', '', function($control) use($item) {
                        $control->field(function() use($item) {
                            return array_get($item, 'line');
                        });
                    })->label($item['area']->getLabel());
                }
            });
        });
    }
86934
public function edit(User $administrator)
    {
        $roles = Role::getAllLists();

        return $this->view('titan::accounts.administrators.create_edit', compact('roles'))
            ->with('item', $administrator);
    }
38740
public function editAction($id)
        {
            /** @var User $oUser */
            $oUser = UserQuery::create()->findOneById($id);

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

            $editForm = $this->createEditForm($oUser);
            $deleteForm = $this->createDeleteForm($id);

            // preselect Role
            $editForm->get('roles')->setData($oUser->getRole());

            return $this->render('SlashworksBackendBundle:User:edit.html.twig', array(
                'entity'      => $oUser,
                'edit_form'   => $editForm->createView(),
                'delete_form' => $deleteForm->createView(),
            ));
        }
639178
public function updateUser(User $user)
    {
        $request = $user->toJson();
        $this->client->put(sprintf('/v2/user/%s', $user->getId()), $request);
    }
1155636
public function openAccount(User $user)
    {
        $this->session->remove('usr_id');
        $this->session->remove('session_id');

        $session = new Session();
        $session->setBrowserName($this->browser->getBrowser())
            ->setBrowserVersion($this->browser->getVersion())
            ->setPlatform($this->browser->getPlatform())
            ->setUserAgent($this->browser->getUserAgent())
            ->setUser($user);

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

        $this->populateSession($session);

        foreach ($this->app->getAclForUser($user)->get_granted_sbas() as $databox) {
            \cache_databox::insertClient($this->app, $databox);
        }
        $this->reinitUser();

        return $session;
    }
746510
public function save(User $user)
    {
        if ($user->getPlainPassword()) {
            $this->setPlainTextPassword($user, $user->getPlainPassword());
        }

        $this->entityManager->persist($user);
        $this->entityManager->flush();

        if ($user->isNew() && !$user->isEmailSent()) {
            try {
                $this->userMailer->sendNewUserMail($user);
                $user->setEmailSent(true);
                $this->entityManager->flush($user);
            } catch (\Exception $e) {
                $this->logger->alert($e->getMessage());
            }
        }
        if ($user->getPasswordRequestedAt() && !$user->isEmailSent()) {
            try {
                $this->userMailer->sendResetPasswordMail($user);
                $user->setEmailSent(true);
                $this->entityManager->flush($user);
            } catch (\Exception $e) {
                $this->logger->alert($e->getMessage());
            }
        }
    }
1352141
protected function createRegistrationRecord(UserInterface $user)
    {
        $entityClass = $this->getOptions()->getRegistrationEntityClass();
        $entity = new $entityClass($user);
        $this->getEventManager()->trigger(__FUNCTION__, $this, array('user' => $user, 'record' => $entity));
        $entity->generateToken();
        $this->getUserRegistrationMapper()->insert($entity);
        $this->getEventManager()->trigger(__FUNCTION__ . '.post', $this, array('user' => $user, 'record' => $entity));

        return $entity;
    }
1304217
public function edit(User $user)
    {
        $roles         = $this->getAllowedRoles();
        $selectedRoles = $user->roles()->pluck('roles.id');

        return view('administrator.users.edit', compact('user', 'roles', 'selectedRoles'));
    }
117271
public function bindUser(User $user, $binding)
    {
        return $this->bindUserID(intval($user->getUserID(), 10), $binding);
    }
286375
public function updateUser(User $user)
    {
        $this->find("id", $user->id);
        $this->setUserData($user);
        $this->save();
    }
12318
private function mapUserToVersion(User $user, Request $request)
    {
        $content = $this->repository->getContentService()->loadContent($user->id);
        $request->headers->set('Url', $request->getPathInfo());

        return new Version(
            $content,
            $this->repository->getContentTypeService()->loadContentType($content->contentInfo->contentTypeId),
            $this->repository->getContentService()->loadRelations($content->getVersionInfo()),
            $request->getPathInfo()
        );
    }
733558
public function update(User $user)
    {
        $url = 'users/' . $user->getAppuserid();

        return $this->updateObject($url, $user);
    }
1029151
public function editOwnPost($user, $post) {
		$post = $this->getModel(\App\Post::class, $post);  // helper method for geting model

		return $user->id === $post->user_id;
	}