Show the account security form.

@param \Illuminate\Http\Request $request

@return \Illuminate\View\View
424139
public function index(Request $request)
    {
        $twoFactor = $request->user($this->getGuard())->getTwoFactor();

        return view('cortex/auth::managerarea.pages.account-twofactor', compact('twoFactor'));
    }
659244
public function indexAction(Request $request)
    {

        /** @var \Networking\InitCmsBundle\Lib\PhpCacheInterface $phpCache */
        $phpCache = $this->get('networking_init_cms.lib.php_cache');

        /** @var PageSnapshotInterface $page */
        $page = $request->get('_content');

        $template = $request->get('_template');
        if ($template instanceof \Sensio\Bundle\FrameworkExtraBundle\Configuration\Template) {
            $template = $template->getTemplate();
        }
        $user = $this->getUser();

        if ($phpCache->isCacheable($request, $user) && $page instanceof PageSnapshotInterface) {
            if (!$this->isSnapshotActive($page)) {
                throw new NotFoundHttpException();
            }

            if ($this->getSnapshotVisibility($page) != PageInterface::VISIBILITY_PUBLIC) {
                if (false === $this->get('security.authorization_checker')->isGranted('ROLE_USER')) {
                    throw new AccessDeniedException();
                }
            }

            $updatedAt = $phpCache->get(sprintf('page_%s_created_at', $page->getId()));
            $cacheKey = $request->getLocale().$request->getPathInfo();

            if ($updatedAt != $page->getSnapshotDate()) {
                $phpCache->delete($cacheKey);
            }

            $response = $phpCache->get($request->getLocale().$request->getPathInfo());

            if (!$response || !$response instanceof Response) {
                $params = $this->getPageParameters($request);

                if ($params instanceof RedirectResponse) {
                    return $params;
                }
                $html = $this->renderView(
                    $template,
                    $params
                );
                $response = new Response($html);

                $phpCache->set($cacheKey, $response);
                $phpCache->set(sprintf('page_%s_created_at', $page->getId()), $page->getSnapshotDate());
            } else {
                $phpCache->touch($cacheKey);
                $phpCache->touch(sprintf('page_%s_created_at', $page->getId()));
            }
        } else {
            $params = $this->getPageParameters($request);

            if ($params instanceof RedirectResponse) {
                return $params;
            }
            $html = $this->renderView(
                $template,
                $params
            );
            $response = new Response($html);
        }

        if ($this->getPageHelper()->isAllowLocaleCookie() && !$this->getPageHelper()->isSingleLanguage()) {
            $response->headers->setCookie(new Cookie('_locale', $request->getLocale()));
        }

        return $response;
    }
342041
public function indexAction(Request $request)
    {
        $this->init($request);

        $nodeAdminListConfigurator = new NodeAdminListConfigurator(
            $this->em,
            $this->aclHelper,
            $this->locale,
            PermissionMap::PERMISSION_VIEW,
            $this->authorizationChecker
        );

        $locale = $this->locale;
        $acl = $this->authorizationChecker;
        $itemRoute = function (EntityInterface $item) use ($locale, $acl) {
            if ($acl->isGranted(PermissionMap::PERMISSION_VIEW, $item->getNode())) {
                return array(
                    'path' => '_slug_preview',
                    'params' => ['_locale' => $locale, 'url' => $item->getUrl()],
                );
            }
        };
        $nodeAdminListConfigurator->addSimpleItemAction('action.preview', $itemRoute, 'eye');
        $nodeAdminListConfigurator->setDomainConfiguration($this->get('kunstmaan_admin.domain_configuration'));
        $nodeAdminListConfigurator->setShowAddHomepage($this->getParameter('kunstmaan_node.show_add_homepage') && $this->isGranted('ROLE_SUPER_ADMIN'));

        /** @var AdminList $adminlist */
        $adminlist = $this->get('kunstmaan_adminlist.factory')->createList($nodeAdminListConfigurator);
        $adminlist->bindRequest($request);

        return array(
            'adminlist' => $adminlist,
        );
    }
678987
public function indexAction(Request $request)
    {
        $language = $this->getLanguage($request);
        $webspace = $this->getWebspace($request);

        $result = $this->getRepository()->getIndexNode($webspace, $language);

        return $this->handleView($this->view($result));
    }
12996
public function listAction(Request $request)
    {
        $this->denyAccessUnlessGranted('ROLE_SUPER_ADMIN');

        $em = $this->getDoctrine()->getManager();
        /* @var AdminList $adminlist */
        $adminlist = $this->container->get('kunstmaan_adminlist.factory')->createList(new RoleAdminListConfigurator($em));
        $adminlist->bindRequest($request);

        return array(
            'adminlist' => $adminlist,
        );
    }
1152545
public function indexAction(Request $request)
    {
        $this->get('white_october_breadcrumbs')
            ->addItem('Home', $this->get('router')->generate('_homepage'))
        ;

        $chart = $this->get('phospr.account_handler')
            ->getChartOfAccounts()
        ;

        return array(
            'favourite_accounts' => $this->get('phospr.account_handler')
                ->getFavouriteAccountsForUser(
                    $this->get('security.context')
                        ->getToken()
                        ->getUser()
                )
        );
    }
1196318
public function password(Request $request)
    {
        $user = $request->user();

        if ($user) {
            return view('user.password')
            ->with('user', $user);
        }

        return back()->withErrors(['Could not find user']);
    }
523839
public function cgetAction(Request $request)
    {
        $checkForPermissions = $request->get('checkForPermissions', true);
        $locale = $this->getRequestParameter($request, 'locale', true);
        $webspaces = [];

        $securityChecker = $this->get('sulu_security.security_checker');
        foreach ($this->get('sulu_core.webspace.webspace_manager')->getWebspaceCollection() as $webspace) {
            if ($checkForPermissions) {
                $securityContext = $this->getSecurityContextByWebspace($webspace->getKey());
                if (!$securityChecker->hasPermission(new SecurityCondition($securityContext), PermissionTypes::VIEW)) {
                    continue;
                }
            }

            $webspaces[] = $webspace;
        }

        $context = new Context();
        $context->setAttribute('locale', $locale);
        $view = $this->view(new CollectionRepresentation($webspaces, 'webspaces'));
        $view->setContext($context);

        return $this->handleView($view);
    }
218633
public function listAction(Request $request)
    {
        $this->checkAccess('LIST', null);
        $resources = $this->getResourceManager()->findAll();
        $view = $this->view($resources, \FOS\RestBundle\Util\Codes::HTTP_OK);
        return $this->handleView($view);
    }
68375
public function index(Request $request)
    {
        $keyword = $request->get('search');
        $perPage = 15;

        if (!empty($keyword)) {
            $roles = Role::where('name', 'LIKE', "%$keyword%")->orWhere('label', 'LIKE', "%$keyword%")
                ->latest()->paginate($perPage);
        } else {
            $roles = Role::latest()->paginate($perPage);
        }

        return view('admin.roles.index', compact('roles'));
    }
970229
public function authenticateAction(Request $request)
    {
        if(!$this->getUser())
        {
            //Get redirecting route
            $referer = $request->headers->get('referer');
            //Get section on the page to be redirected at
            $pageSection = $request->get('section', false);

            $this->get('session')->set('refererUrl', $referer);

            if($pageSection)
            {
                $this->get('session')->set('refererUrlSection', $pageSection);
            }
        }

        $user = $this->get('security.token_storage')->getToken()->getUser();
        if (!is_object($user) || !$user instanceof UserInterface)
        {
            throw new AccessDeniedException('Please login first.');
        }

        $redirectURL = $this->get('session')->get('refererUrl', null);
        $redirectURLSection = $this->get('session')->get('refererUrlSection', null);

        if(!$redirectURL || $redirectURL == $this->generateUrl('ed_blog_redirect_authenticate', array(), true))
        {
            return $this->redirectToRoute("ed_blog_homepage_index");
        }
        else
        {
            if($redirectURLSection)
            {
                $redirectURL .= '#' . $redirectURLSection;
                $this->get('session')->remove('refererUrlSection');
            }

            $this->get('session')->remove('refererUrl');

            return $this->redirect($redirectURL) ;
        }

    }
1282040
public function viewAction(Request $request)
    {
        $id = $request->get('id');

        $taskManager = $this->get('phlexible_task.task_manager');
        $types = $this->get('phlexible_task.types');
        $userManager = $this->get('phlexible_user.user_manager');

        $task = $taskManager->find($id);

        $createUser = $userManager->find($task->getCreateUserId());
        $assignedUser = $userManager->find($task->getAssignedUserId());

        $transitions = [];
        foreach ($task->getTransitions() as $transition) {
            $transitionUser = $userManager->find($transition->getCreateUserId());
            $history[] = [
                'create_date' => $transition->getCreatedAt()->format('Y-m-d H:i:s'),
                'name' => $transitionUser->getDisplayName(),
                'status' => $transition->getNewState(),
                'latest' => 1,
            ];
        }
        $transitions = array_reverse($transitions);

        $comments = [];
        foreach ($task->getComments() as $comment) {
            $commentUser = $userManager->find($comment->getCreateUserId());
            $history[] = [
                'create_date' => $comment->getCreatedAt()->format('Y-m-d H:i:s'),
                'name' => $commentUser->getDisplayName(),
                'status' => $comment->getCurrentState(),
                'comment' => $comment->getComment(),
                'latest' => 1,
            ];
        }

        $type = $types->get($task->getType());

        $data = [
            'id' => $task->getId(),
            'type' => $task->getType(),
            'title' => $type->getTitle($task),
            'text' => $type->getText($task),
            'component' => $type->getComponent(),
            'created' => $task->getCreateUserId() === $this->getUser()->getId() ? 1 : 0,
            'assigned' => $task->getAssignedUserId() === $this->getUser()->getId() ? 1 : 0,
            'assigned_user' => $assignedUser->getDisplayName(),
            'assigned_uid' => $task->getAssignedUserId(),
            'create_user' => $createUser->getDisplayName(),
            'create_uid' => $task->getCreateUserId(),
            'create_date' => $task->getCreatedAt()->format('Y-m-d H:i:s'),
            'latest_status' => $task->getFiniteState(),
            'latest_comment' => '', //$latestStatus->getComment(),
            'latest_user' => '', //$assignedUser->getDisplayName(),
            'latest_uid' => '', //$latestStatus->getCreateUserId(),
            'latest_date' => '', //$latestStatus->getCreatedAt()->format('Y-m-d H:i:s'),
            //'recipient_uid'  => $task->getRecipientUserId(),
            //'latest_id'      => $latestStatus->getId(),
            'transitions' => $transitions,
            'comments' => $comments,
        ];

        return new JsonResponse($data);
    }
299025
public function infoAction(Request $request)
    {
        $securityContext = $this->get('security.context');

        $lines = [];

        if ($securityContext->isGranted('ROLE_SUPER_ADMIN')) {
            $lines[] = [
                'Project:',
                $this->container->getParameter('phlexible_gui.project.title').' '
                    .$this->container->getParameter('phlexible_gui.project.version'),
            ];
            $lines[] = [
                'Env:',
                $this->container->getParameter('kernel.environment').($this->container->getParameter(
                    'kernel.debug'
                ) ? ' [DEBUG]' : ''),
            ];
            $lines[] = ['Host:', $request->server->get('SERVER_NAME').' ['.PHP_SAPI.']'];

            $connection = $this->getDoctrine()->getConnection();
            /* @var $connection \Doctrine\DBAL\Connection */

            $lines[] = [
                'Default Database:',
                $connection->getHost().' / '.$connection->getDatabase().' ['.$connection->getDriver()->getName(
                ).']',
            ];

            $lines[] = ['Session:', $request->getSession()->getId().' ['.$request->server->get('REMOTE_ADDR').']'];

            $lines[] = [
                'User:',
                $this->getUser()->getUsername().' ['.implode(', ', $this->getUser()->getRoles()).']',
            ];

            $lines[] = ['UserAgent:', $request->server->get('HTTP_USER_AGENT')];
        } else {
            $lines[] = [
                'Project:',
                $this->container->getParameter('phlexible_gui.project.title').' '
                .$this->container->getParameter('phlexible_gui.project.version'),
            ];
        }

        $l1 = 0;
        $l2 = 0;
        foreach ($lines as $line) {
            if (strlen($line[0]) > $l1) {
                $l1 = strlen($line[0]);
            }
            if (isset($line[1]) && strlen($line[1]) > $l2) {
                $l2 = strlen($line[1]);
            }
        }
        $table = '';
        foreach ($lines as $line) {
            $table .= str_pad($line[0], $l1 + 2);
            $table .= str_pad($line[1], $l2 + 2);
            if (isset($line[2])) {
                $table .= $line[2];
            }
            $table .= PHP_EOL;
        }
        $out = '<pre>'.$table.'</pre>';

        return new Response($out);
    }
889255
public function authentication(Request $request)
    {
        try {
            $this->authRepositoryInterface->authenticate($request->all());
        } catch (FormValidationException $e) {
            Flash::error($e->getMessage());

            return redirect()
              ->route('auth.login')
              ->withErrors($e->getErrors());
        } catch (AuthenticationException $e) {
            Flash::error($e->getMessage());

            return redirect()->route('auth.login');
        }

        return redirect()->route('dashboard.index');
    }
588545
public function indexAction(Request $request)
    {
        /* @var EntityManager $em */
        $em = $this->getDoctrine()->getManager();
        $aclHelper = $this->container->get('kunstmaan_admin.acl.helper');

        /* @var AdminList $adminList */
        $adminList = $this->get('kunstmaan_adminlist.factory')->createList(
            new FormPageAdminListConfigurator($em, $aclHelper, PermissionMap::PERMISSION_VIEW),
            $em
        );
        $adminList->bindRequest($request);

        return array('adminlist' => $adminList);
    }
607918
public function forUser(Request $request)
    {
        $userId = $request->user()->getKey();

        return $this->clients->activeForUser($userId)->makeVisible('secret');
    }
283686
public function show(Request $request, $user)
    {
        // Set roles that have access
        $request->user()->authorizeRoles(['admin']);

        // Return view with user object
        $user = User::findOrFail($user);
        return view('user::show', ['user' => $user]);
    }