Finish displaying the regrade progress page.
@param moodle_url $nexturl where to send the user after the regrade.
@uses exit. This method never returns.
777913
protected function finish_regrade($nexturl) {
        global $OUTPUT;
        \core\notification::success(get_string('regradecomplete', 'quiz_overview'));
        echo $OUTPUT->continue_button($nexturl);
        echo $OUTPUT->footer();
        die();
    }
550868
protected function _lastAction($url)
    {
        $action = Router::url($url, true);
        $query = parse_url($action, PHP_URL_QUERY);
        $query = $query ? '?' . $query : '';
        $this->_lastAction = parse_url($action, PHP_URL_PATH) . $query;
    }
462605
def next_redirect(request, fallback, **get_kwargs):
    
    next = request.POST.get('next')
    if not is_safe_url(url=next, allowed_hosts=request.get_host()):
        next = resolve_url(fallback)

    if get_kwargs:
        if '#' in next:
            tmp = next.rsplit('#', 1)
            next = tmp[0]
            anchor = '#' + tmp[1]
        else:
            anchor = ''

        joiner = ('?' in next) and '&' or '?'
        next += joiner + urlencode(get_kwargs) + anchor
    return HttpResponseRedirect(next)
1005019
protected function tryViaUrl($url, $timeout = 6)
    {
        $result = $this->doNTLMPost($url, $timeout);
        return ($result ? true : false);
    }
619681
public function next()
    {
        /** @var VO $vo */
        $vo = next($this->results);
        $this->currentKey = key($this->results);

        if ($this->currentKey === null) {
            if ($this->ended !== true) {
                $this->reloadResults();
            }
        } else {
            $this->lastId = $vo->getId();
        }
    }
141491
public function handle($request, Closure $next)
    {
        if (! $this->checkIfUserCanEditPost($request)) {
            return redirect()->route('admin.dashboard');
        }

        return $next($request);
    }
743029
public function backup_details_nonstandard($nextstageurl, array $details) {

        $html  = html_writer::start_tag('div', array('class' => 'backup-restore nonstandardformat'));
        $html .= html_writer::start_tag('div', array('class' => 'backup-section'));
        $html .= $this->output->heading(get_string('backupdetails', 'backup'), 2, 'header');
        $html .= $this->output->box(get_string('backupdetailsnonstandardinfo', 'backup'), 'noticebox');
        $html .= $this->backup_detail_pair(
            get_string('backupformat', 'backup'),
            get_string('backupformat'.$details['format'], 'backup'));
        $html .= $this->backup_detail_pair(
            get_string('backuptype', 'backup'),
            get_string('backuptype'.$details['type'], 'backup'));
        $html .= html_writer::end_tag('div');
        $html .= $this->output->single_button($nextstageurl, get_string('continue'), 'post');
        $html .= html_writer::end_tag('div');

        return $html;
    }
773867
public function handle(Request $request, Closure $next)
    {
        if ($this->page->aclEnabled()) {
            if (!$this->guard->check()) {
                return new RedirectResponse(route('login'));
            }

            if ($this->gate->denies('view', $this->page)) {
                abort(403);
            }
        }

        return $next($request);
    }
1134608
function ntlmsso_finish() {
        global $CFG, $USER, $SESSION;

        $key = sesskey();
        $username = get_cache_flag($this->pluginconfig.'/ntlmsess', $key);
        if (empty($username)) {
            return false;
        }

        // Here we want to trigger the whole authentication machinery
        // to make sure no step is bypassed...
        $reason = null;
        $user = authenticate_user_login($username, $key, false, $reason, false);
        if ($user) {
            complete_user_login($user);

            // Cleanup the key to prevent reuse...
            // and to allow re-logins with normal credentials
            unset_cache_flag($this->pluginconfig.'/ntlmsess', $key);

            // Redirection
            if (user_not_fully_set_up($USER, true)) {
                $urltogo = $CFG->wwwroot.'/user/edit.php';
                // We don't delete $SESSION->wantsurl yet, so we get there later
            } else if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)) {
                $urltogo = $SESSION->wantsurl;    // Because it's an address in this site
                unset($SESSION->wantsurl);
            } else {
                // No wantsurl stored or external - go to homepage
                $urltogo = $CFG->wwwroot.'/';
                unset($SESSION->wantsurl);
            }
            // We do not want to redirect if we are in a PHPUnit test.
            if (!PHPUNIT_TEST) {
                redirect($urltogo);
            }
        }
        // Should never reach here.
        return false;
    }
1124720
private function wrapUrl($url)
    {
        if ($this->balancer) {
            $url = sprintf('%s?url=%s', $this->balancer, urlencode($url));
        }

        $this->lastUrl = $url;

        return $url;
    }
137367
public function import_course_selector(moodle_url $nextstageurl, import_course_search $courses = null) {
        $html  = html_writer::start_tag('div', array('class' => 'import-course-selector backup-restore'));
        $html .= html_writer::start_tag('form', array('method' => 'post', 'action' => $nextstageurl->out_omit_querystring()));
        foreach ($nextstageurl->params() as $key => $value) {
            $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => $key, 'value' => $value));
        }
        // We only allow import adding for now. Enforce it here.
        $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'target', 'value' => backup::TARGET_CURRENT_ADDING));
        $html .= html_writer::start_tag('div', array('class' => 'ics-existing-course backup-section'));
        $html .= $this->output->heading(get_string('importdatafrom'), 2, array('class' => 'header'));
        $html .= $this->backup_detail_pair(get_string('selectacourse', 'backup'), $this->render($courses));
        $attrs = array('type' => 'submit', 'value' => get_string('continue'), 'class' => 'btn btn-primary');
        $html .= $this->backup_detail_pair('', html_writer::empty_tag('input', $attrs));
        $html .= html_writer::end_tag('div');
        $html .= html_writer::end_tag('form');
        $html .= html_writer::end_tag('div');
        return $html;
    }
911182
function nextStep()
    {
        if ( $this->metaData( 'current_stage' ) == eZWizardBase::STAGE_PRE )
        {
            $this->setMetaData( 'current_stage', eZWizardBase::STAGE_POST );
        }
        else
        {
            $this->setMetaData( 'current_stage', eZWizardBase::STAGE_PRE );
            $this->setMetaData( 'current_step', $this->metaData( 'current_step' ) + 1 );

            return $this->Module->redirectTo( $this->WizardURL );
        }

        $this->savePersistentData();
    }
972355
protected function log_convert_url(moodle_url $fullurl) {
        static $baseurl;

        if (!isset($baseurl)) {
            $baseurl = new moodle_url('/mod/workshop/');
            $baseurl = $baseurl->out();
        }

        return substr($fullurl->out(), strlen($baseurl));
    }
696806
public function redirect($url = null, $exitAfter = true)
    {
        if (empty($url)) {
            $authRequest = $this->_stateMgr->get('authRequest');
            /* @var AuthRequest $authRequest */
            if ($authRequest) {
                $url = $authRequest->getReturnUrl();
                $this->_stateMgr->set('authRequest');
            }
        }
        parent::redirect($url, $exitAfter);
    }
94025
public function redirect($url)
    {
        // has redirect from upstream
        if (($this->status === 301 || $this->status === 302) && ($this->hasHeader('location'))) {
            return;
        }
        // @fixme need a better solution
        $this->numRedirected--;
        $this->status = 302;
        $this->setHeader('location', $url);
    }
644866
public function run($url = null)
    {
        if (is_null($this->route)) {
            throw new Exception("This is an invalid route.");
        }

        // Allow plugins and the code outside the MVC system to cancel
        // a route.
        if (function_exists('apply_filters')) {
            $url = apply_filters('strata_on_before_url_routing', $url);
        }

        $this->route->process($url);

        if ($this->route->isValid()) {
            return $this->route->attemptCompletion();
        }

        $controllerClass = get_class($this->route->controller);
        $messagePattern = "<warning>%s#%s is not a matched Strata route.</warning>";
        $this->log(sprintf($messagePattern, $controllerClass, $this->route->action));
    }
21063
public function error($nextUrl, $detail = null)
    {
        // If the signature is invalid, then do not allow the reject.

        if (! $this->isValid()) {
            throw new InvalidResponseException('Cannot reject an invalid notification');
        }

        $this->sendResponse(static::RESPONSE_STATUS_ERROR, $nextUrl, $detail);
    }