Redirects the user to the list view.

@return RedirectResponse
194935
final protected function redirectToList()
    {
        $parameters = [];

        if ($filter = $this->admin->getFilterParameters()) {
            $parameters['filter'] = $filter;
        }

        return $this->redirect($this->admin->generateUrl('list', $parameters));
    }
327234
public function listAction()
    {
        $request = $this->getRequest();

        $this->admin->checkAccess('list');

        $preResponse = $this->preList($request);
        if (null !== $preResponse) {
            return $preResponse;
        }

        if ($listMode = $request->get('_list_mode')) {
            $this->admin->setListMode($listMode);
        }

        $datagrid = $this->admin->getDatagrid();
        $formView = $datagrid->getForm()->createView();

        // set the theme for the current Admin Form
        $this->setFormTheme($formView, $this->admin->getFilterTheme());

        // NEXT_MAJOR: Remove this line and use commented line below it instead
        $template = $this->admin->getTemplate('list');
        // $template = $this->templateRegistry->getTemplate('list');

        return $this->renderWithExtraParams($template, [
            'action' => 'list',
            'form' => $formView,
            'datagrid' => $datagrid,
            'csrf_token' => $this->getCsrfToken('sonata.batch'),
            'export_formats' => $this->has('sonata.admin.admin_exporter') ?
                $this->get('sonata.admin.admin_exporter')->getAvailableFormats($this->admin) :
                $this->admin->getExportFormats(),
        ], null);
    }
189253
public function index() {

        // Is this user allowed to do this?
        if (!$this->repository->isUserAllowed('index')) {

            Session::flash('status_code', 400 );
            $message = "You are not allowed to view the list of ".$this->tableName;
            Session::flash('message', $message);
            return view('formhandling::warnings/' . config('lasallecmsadmin.admin_template_name') . '/user_not_allowed', [
                'package_title'                => $this->model->package_title,
                'table_type_plural'            => $this->model->table,
                'resource_route_name'          => $this->model->resource_route_name,
                'table_type_singular'          => strtolower($this->model->model_class),
                'HTMLHelper'                   => HTMLHelper::class,
            ]);
        }

        // If this user has locked records for this table, then unlock 'em
        $this->repository->unlockMyRecords($this->model->table);

        $records = $this->repository->getEmailMessagesForAdminIndex(Auth::user()->id);

        return view('lasallecmsemail::admin/emailhandling/index',
            [
                'records'                      => $records,
                'package_title'                => $this->model->package_title,
                'table_name'                   => $this->model->table,
                'model_class'                  => $this->model->model_class,
                'resource_route_name'          => $this->model->resource_route_name,
                'DatesHelper'                  => DatesHelper::class,
                'HTMLHelper'                   => HTMLHelper::class,
                'Config'                       => Config::class,
                'admin_template_name'          => config('lasallecmsadmin.admin_template_name'),
            ]);
    }
117661
private function getRedirectRouteFromRequest()
    {
        $request  = $this->application->getRequest();
        $redirect = $request->getQuery('redirect');
        if ($redirect && $this->routeExists($redirect)) {
            return $redirect;
        }

        $redirect = $request->getPost('redirect');
        if ($redirect && $this->routeExists($redirect)) {
            return $redirect;
        }

        return false;
    }
625777
protected function registerRedirect()
    {
        $this->app->singleton('redirect', function ($app) {
            $redirect = new Redirector($app['url']);

            $redirect->setSession($app['session']);

            return $redirect;
        });
    }
245483
protected function _get()
    {
        $subject = $this->_subject();
        $this->_trigger('beforeLogout', $subject);

        $subject->set([
            'success' => true,
            'redirectUrl' => $this->_controller()->Auth->logout()
        ]);

        $this->_trigger('afterLogout', $subject);
        $this->setFlash('success', $subject);

        return $this->_redirect(
            $subject,
            $subject->redirectUrl
        );
    }
649586
public function activateAction()
    {
        $object = $this->getObject();
        
        if (method_exists($object, 'setActive') && method_exists($object, 'getActive')) {
            $object->setActive(($object->getActive()==1) ? 0 : 1);
        }
        
        $this->admin->update($object);        
        
        return new RedirectResponse($this->admin->generateUrl('list'));
    }
1179325
public function redirect()
    {
        if (!$this->isStateless()) {
            $this->request->getSession()->put(
                'oauth.temp', $temp = $this->server->getTemporaryCredentials()
            );
        } else {
            $temp = $this->server->getTemporaryCredentials();
            $this->request->session()->put('oauth_temp', serialize($temp));
        }

        return new RedirectResponse($this->server->getAuthorizationUrl($temp));
    }
1027774
public function indexAction()
    {
        if (!$this->rcmUserService->isAllowed(ResourceName::RESOURCE_SITES, 'admin')) {
            $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);

            return $this->getResponse();
        }

        $this->layout()->setTemplate('layout/blank');

        $view = new ViewModel();
        $view->setVariable(
            'siteSettingsSectionDefinitions',
            $this->getSettingsSectionDefinitions->__invoke()
        );

        return $view;
    }
730467
public function redirect()
    {
        $this->request->session()->put(
            'oauth.temp', $temp = $this->server->getTemporaryCredentials()
        );

        return new RedirectResponse($this->server->getAuthorizationUrl($temp));
    }
962319
public function login() {
        if ($this->request->is('post')) {
            $user = $this->Auth->identify();
            if ($user) {
                $this->Auth->setUser($user);
                return $this->redirect($this->Auth->redirectUrl());
            }
            $this->Flash->error(__('Your username or password is incorrect.'));
        }

        // Set signin layout from Builder.Layout
        $this->viewBuilder()->layout('signin');
        // Use the layout without Template 
        $this->render(false);
    }
793541
public function redirect()
    {
        $previous = Url::previous(Widget::RETURN_URL_PARAM);

        return !empty($this->redirectUrl) ? $this->controller->redirect($this->redirectUrl)
            : $this->controller->redirect($previous);
    }
591730
public function index() {
        // Is this user allowed to do this?
        if (!$this->repository->isUserAllowed('index'))
        {
            Session::flash('status_code', 400 );
            $message = "You are not allowed to view the list of ".$this->table_name;
            Session::flash('message', $message);
            return view('formhandling::warnings/' . config('lasallecmsadmin.admin_template_name') . '/user_not_allowed', [
                'package_title'        => $this->model->package_title,
                'table_type_plural'    => $this->model->table,
                'table_type_singular'  => strtolower($this->model->model_class),
                'resource_route_name'  => $this->resource_route_name,
                'HTMLHelper'           => HTMLHelper::class,
                'Crypt'                => Crypt::class,
            ]);
        }


        // If this user has locked records for this table, then unlock 'em
        $this->repository->unlockMyRecords($this->model->table);

        return view('formhandling::adminformhandling/' . config('lasallecmsadmin.admin_template_name') . '/index',
        [
            'display_the_view_button'      => $this->model->display_the_view_button,
            'records'                      => $this->repository->getAll(),
            'repository'                   => $this->repository,
            'package_title'                => $this->model->package_title,
            'table_name'                   => $this->model->table,
            'model_class'                  => $this->model->model_class,
            'resource_route_name'          => $this->model->resource_route_name,
            'field_list'                   => $this->getFieldList(),
            'suppress_delete_button_when_one_record' => $this->model->suppress_delete_button_when_one_record,
            'DatesHelper'                  => DatesHelper::class,
            'HTMLHelper'                   => HTMLHelper::class,
            'carbon'                       => Carbon::class,
            'Config'                       => Config::class,
            'Form'                         => Form::class,
            'Crypt'                        => Crypt::class,
        ]);
    }
886850
public function changeEmailAction()
    {
        if(!$user = $this->identity()) {
            return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute());
        }

        $form = $this->getUserFormHelper()->createUserForm($user, 'ChangeEmail');
        $message = null;        
        if($this->getRequest()->isPost()) {
            $currentPassword = $user->getPassword();
            $form->setValidationGroup('password', 'newEmail', 'newEmailVerify', 'csrf');
            $form->setData($this->getRequest()->getPost());
            if($form->isValid()) {
                $data = $form->getData();
                $user->setPassword($currentPassword);
                if(UserCredentialsService::verifyHashedPassword($user, $this->params()->fromPost('password'))) {
                    $newMail = $this->params()->fromPost('newEmail');
                    $email = $user->setEmail($newMail);
                    $entityManager = $this->getEntityManager();
                    $entityManager->persist($user);
                    $entityManager->flush();
                    
                    $viewModel = new ViewModel(array(
                        'email' => $newMail,
                        'navMenu' => $this->getOptions()->getNavMenu()
                    ));
                    $viewModel->setTemplate('csn-user/registration/change-email-success');
                    return $viewModel;
                } else {
                    $message = $this->getTranslatorHelper()->translate('Your current password is not correct.');
                }
            }
        }

        return new ViewModel(array('form' => $form, 'navMenu' => $this->getOptions()->getNavMenu(), 'message' => $message));
    }
107400
public function redirectIntended()
    {
        // Make sure we have a route.
        if (is_null($this->route)) {
            throw new \Exception('No route has been provided.  Please use route() to add one.');
        }

        // If this response passed, show the success message.
        if ($this->success) {
            return redirect()
                ->intended($this->route)
                ->with('message', $this->message);
        }

        // If this response failed, show the error message.
        return redirect($this->route)
            ->with('error', $this->message);
    }
823457
public function addAction()
    {
        $request = $this->getRequest();
        $service = $this->getService();
        $form    = $this->getAddForm();

        //if ($this->getOptions()->getUseRedirectParameterIfPresent() && $request->getQuery()->get('redirect')) {
        if ($request->getQuery()->get('redirect')) {
            $redirect = $request->getQuery()->get('redirect');
        } else {
            $redirect = false;
        }

        $redirectUrl = $this->url()->fromRoute($this->getAddActionRoute())
                     . ($redirect ? '?redirect=' . $redirect : '');

        $prg = $this->prg($redirectUrl, true);

        if ($prg instanceof Response) {
            return $prg;
        } elseif ($prg === false) {
            return array(
                'options'  => $this->getOptions(),
                'form'     => $form,
                'redirect' => $redirect,
            );
        }

        $post   = $prg;
        $entity = $service->create($post);

        $redirect = isset($prg['redirect']) ? $prg['redirect'] : null;

        if (!$entity) {
            return array(
                'options'  => $this->getOptions(),
                'form'     => $form,
                'redirect' => $redirect,
            );
        }

        // TODO: Add the redirect parameter here...
        return $this->redirect()->toUrl($this->url()->fromRoute($this->getRouteIdentifierPrefix()) . ($redirect ? '?redirect='.$redirect : ''));
    }
1192951
public function redirect() {

    if (isset($_GET['view'])) {
      $view = "view=" . $_GET['view'];
    } else {
      $view = "view=return";
    }

    $return_url = substr(BASE_URL, 0, -12) . 'index.php?' . $view . '&transactionid=' . $_GET['transactionid'];
    header("Location: " . $return_url);
  }