User profile page route.

@param Request $request The Symfony Request

@return \Bolt\Response\TemplateResponse|\Symfony\Component\HttpFoundation\RedirectResponse
179927
public function profile(Request $request)
    {
        $userEntity = $this->getUser();
        if ($userEntity === false) {
            return $this->redirectToRoute('users');
        }

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

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

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

            return $this->redirectToRoute('profile');
        }

        $context = [
            'kind'        => 'profile',
            'form'        => $form->createView(),
            'note'        => '',
            'displayname' => $userEntity->getDisplayname(),
        ];

        return $this->render('@bolt/edituser/edituser.twig', $context);
    }
1116320
public function postRegister(RegisterRequest $request)
    {
        if (! \Setting::get('user::enable-registration')) {
            return redirect()->route('login');
        }

        \Auth::login($this->create($request->all()));

        return redirect($this->redirectPath());
    }
213393
public function findByRequest(Request $request): ?PageInterface
    {
        if (null !== $route = $request->attributes->get('_route', null)) {
            return $this->findByRoute($route);
        }

        return null;
    }
1181851
public function indexAction(Request $request)
    {
        /** @var HttpErrorRepository $errorRepository */
        $errorRepository = $this->getDoctrine()->getManager()->getRepository('VictoireSeoBundle:HttpError');

        // Fetch errors

        $routes = $errorRepository->getRouteErrors();
        $routesResults = $routes->getQuery()->getResult();

        $files = $errorRepository->getFileErrors();
        $filesResults = $files->getQuery()->getResult();

        // Build forms

        $forms = [];
        $errors = array_merge($routesResults, $filesResults);

        /** @var Error404 $error */
        foreach ($errors as $error) {
            $redirection = new ErrorRedirection();
            $redirection->setError($error);
            $forms[$error->getId()] = $this->getError404RedirectionForm($redirection)->createView();
        }

        // Return datas

        return new Response($this->renderView('@VictoireSeo/Error404/index.html.twig', [
            'routes' => $routesResults,
            'files'  => $filesResults,
            'forms'  => $forms,
        ]));
    }
881640
public function newAction(Request $request)
    {
        $location = new Location();
        $location->setProfile($this->getCurrentProfile());
        $form = $this->createForm(new LocationType(), $location);

        if ($response = $this->processForm($request, $form, 'Profile_location_show'))
        {
            return $response;
        }

        return $this->render('HarvestCloudCoreBundle:Profile/Location:new.html.twig', array(
          'form' => $form->createView(),
        ));
    }
646290
public function userDeleteAction(Request $request): Response
    {
        $form = $this->formFactory->deleteUser();

        $form->handleRequest($request);

        if ($form->isSubmitted()) {
            $result = $this->submitHandler->handle($form, function (UserDeleteData $data) {
                $contentInfo = $data->getContentInfo();

                $location = $this->locationService->loadLocation($contentInfo->mainLocationId);

                $user = $this->userService->loadUser($contentInfo->id);

                $this->userService->deleteUser($user);

                $this->notificationHandler->success(
                    $this->translator->trans(
                        /** @Desc("User with login '%login%' deleted.") */
                        'user.delete.success',
                        ['%login%' => $user->login],
                        'content'
                    )
                );

                return new RedirectResponse($this->generateUrl('_ezpublishLocation', [
                    'locationId' => $location->parentLocationId,
                ]));
            });

            if ($result instanceof Response) {
                return $result;
            }
        }

        return $this->redirect($this->generateUrl('ezplatform.dashboard'));
    }
1315162
public function indexAction( Request $request )
	{
		if( Auth::check() === false
			|| $request->user()->can( 'admin', [AdminController::class, ['admin', 'editor']] ) === false
		) {
			return redirect()->guest( 'login' );
		}

		$siteId = $request->user()->siteid;
		$context = app( 'aimeos.context' )->get( false );
		$siteManager = \Aimeos\MShop::create( $context, 'locale/site' );
		$siteCode = ( $siteId ? $siteManager->getItem( $siteId )->getCode() : 'default' );
		$locale = $request->user()->langid ?: config( 'app.locale', 'en' );

		$param = array(
			'resource' => 'dashboard',
			'site' => Route::input( 'site', Input::get( 'site', $siteCode ) ),
			'lang' => Route::input( 'lang', Input::get( 'lang', $locale ) )
		);

		return redirect()->route( 'aimeos_shop_jqadm_search', $param );
	}
467084
public static function getUserAgentProfile($request)
    {
        if (isset($request["HTTP_X_WAP_PROFILE"])) {
            return $request["HTTP_X_WAP_PROFILE"];
        }
        if (isset($request["HTTP_PROFILE"])) {
            return $request["HTTP_PROFILE"];
        }
        if (isset($request["Opt"])) {
            $opt = $request["Opt"];
            $regex = "/ns=\\d+/";
            $matches = array();
            $namespaceProfile = null;
            if (preg_match($regex, $opt, $matches)) {
                $namespaceProfile = substr($matches[0], 2) . "-Profile";
            }
            if ($namespaceProfile !== null && isset($request[$namespaceProfile])) {
                return $request[$namespaceProfile];
            }
        }

        return null;
    }
709705
public function route(Request $request)
    {
        foreach ($this->getRouterList() as $router) {
            if ($router->getAPIClient()->shouldRouteRequest($request)) {
                return $router->route($request);
            }
        }

        return;
    }
543539
public function homeAction(Request $request)
    {
        // TODO check if AuthenticationCredentialsNotFoundException is raised without a cookie.
        if (!$this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
            $request->getSession()->set('_ekyna.login_success.target_path', 'fos_user_profile_show');
            return $this->redirect($this->generateUrl('fos_user_security_login'));
        }
        return $this->redirect($this->generateUrl('fos_user_profile_show'));
    }
450017
public function getUserProfiles(Request $request){
        if($this->userProfiles === NULL){
            $this->userProfiles= $request->session->exist($this->sessionProfile) ? $request->session->get($this->sessionProfile) : 'default';
        }
        return $this->userProfiles;
    }
863242
public function indexAction(Request $request)
    {
        try {
            $configurator = $this->get('phlexible_element_renderer.configurator');
            $configuration = $configurator->configure($request);
            if ($configuration->hasResponse()) {
                return $configuration->getResponse();
            }
            $data = $configuration->getVariables();

            $template = $data['template'];
            if ($request->attributes->has('template')) {
                $template = $request->attributes->get('template');
            }

            return $this->render($template, (array) $data);

        } catch (NotFoundHttpException $e) {
            $nodeId                 = $this->get('phlexible_siteroot.siteroot_request_matcher')->matchRequest($this->getRequest())->getSpecialTid($request->getLocale(), 'error_' . $e->getStatusCode());
            $contentTreeNode        = $this->get('phlexible_tree.content_tree_manager')->findByTreeId($nodeId)->get($nodeId);
            $url                    = $this->get('router')->generate($contentTreeNode);

            return new RedirectResponse($url);
        }
    }
1347438
public function create_setAction(Request $request)
    {
        try
        {
            $this->getCurrentProfile()->createSetOfAccounts();

            $em = $this->getDoctrine()->getEntityManager();
            $em->persist($this->getCurrentProfile());
            $em->flush();
        }
        catch (\Exception $e)
        {
        }

        return $this->redirect($this->generateUrl('Profile_homepage'));
    }
329949
public function update(UpdateUserRequest $request)
    {
        $this->dispatch(new UpdateUser($this->auth->user()->id, $request->get('name'), $request->get('email')));
        return redirect()->route('authentication::profile.show');
    }
1051131
public function store(Request $request)
	{
        $dataProfile = $request->only('nombres', 'apellidos');
        $dataUser = $request->only('email', 'password');

        $this->validate($request, $this->rulesProfile);
        $this->validate($request, $this->rulesUser);

        $user = new User($dataUser);
        $user->estado = 1;
        $user->save();

        $userProfile = new UserProfile($dataProfile);
        $userProfile->user_id = $user->id;
        $userProfile->save();

        //MENSAJE
        flash()->success('El registro se creó satisfactoriamente.');

        //REDIRECCIONAR A PAGINA PARA VER DATOS
        return redirect()->route('admin.user.index');
	}
985209
public function searchAction(Request $request)
    {
        $this->denyAccessIfProfilerDisabled();

        $ip = preg_replace('/[^:\d\.]/', '', $request->query->get('ip'));
        $method = $request->query->get('method');
        $statusCode = $request->query->get('status_code');
        $url = $request->query->get('url');
        $start = $request->query->get('start', null);
        $end = $request->query->get('end', null);
        $limit = $request->query->get('limit');
        $token = $request->query->get('token');

        if ($request->hasSession()) {
            $session = $request->getSession();

            $session->set('_profiler_search_ip', $ip);
            $session->set('_profiler_search_method', $method);
            $session->set('_profiler_search_status_code', $statusCode);
            $session->set('_profiler_search_url', $url);
            $session->set('_profiler_search_start', $start);
            $session->set('_profiler_search_end', $end);
            $session->set('_profiler_search_limit', $limit);
            $session->set('_profiler_search_token', $token);
        }

        if (!empty($token)) {
            return new RedirectResponse($this->generator->generate('_profiler', ['token' => $token]), 302, ['Content-Type' => 'text/html']);
        }

        $tokens = $this->profiler->find($ip, $url, $limit, $method, $start, $end, $statusCode);

        return new RedirectResponse($this->generator->generate('_profiler_search_results', [
            'token' => $tokens ? $tokens[0]['token'] : 'empty',
            'ip' => $ip,
            'method' => $method,
            'status_code' => $statusCode,
            'url' => $url,
            'start' => $start,
            'end' => $end,
            'limit' => $limit,
        ]), 302, ['Content-Type' => 'text/html']);
    }
1216095
public function route(Request $request)
    {
        $request->setUrl($this->api->getPath($request));

        $routeParameters = $this->getRoute($request);
        if ($routeParameters) {
            $class = $routeParameters['class'];
            $function = $routeParameters['function'];
            $routeClass = new $class($this->integration, $this->api, $request);

            return $routeClass->$function();
        } else {
            return $this->api->callAPI($request);
        }
    }