當前位置: 首頁>>代碼示例>>PHP>>正文


PHP URLBuilder::doRedirect方法代碼示例

本文整理匯總了PHP中URLBuilder::doRedirect方法的典型用法代碼示例。如果您正苦於以下問題:PHP URLBuilder::doRedirect方法的具體用法?PHP URLBuilder::doRedirect怎麽用?PHP URLBuilder::doRedirect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在URLBuilder的用法示例。


在下文中一共展示了URLBuilder::doRedirect方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: processIdRes

/**
 * Processes id_res requests.
 *
 * @param Boolean $valid True if the request has already been authenticated
 */
function processIdRes($valid)
{
    if (isset($_REQUEST['openid_identity'])) {
        if ($_REQUEST['openid_identity'] != $_SESSION['openid']['delegate']) {
            openid_error('diffid', 'Identity provider validated wrong identity. Expected it to ' . 'validate ' . $_SESSION['openid']['delegate'] . ' but it ' . 'validated ' . $_REQUEST['openid_identity']);
        }
        if (!$valid) {
            $dumbauth = true;
            if (KEYMANAGER) {
                try {
                    $valid = KeyManager::authenticate($_SESSION['openid']['server'], $_REQUEST);
                    $dumbauth = false;
                } catch (Exception $ex) {
                    // Ignore it - try dumb auth
                }
            }
            if ($dumbauth) {
                $valid = KeyManager::dumbAuthenticate();
            }
        }
        $_SESSION['openid']['validated'] = $valid;
        if (!$valid) {
            openid_error('noauth', 'Provider didn\'t authenticate response');
        }
        parseSRegResponse();
        URLBuilder::redirect();
    } else {
        if (isset($_REQUEST['openid_user_setup_url'])) {
            if (defined('OPENID_IMMEDIATE') && OPENID_IMMEDIATE) {
                openid_error('noimmediate', 'Couldn\'t perform immediate auth');
            }
            $handle = getHandle($_SESSION['openid']['server']);
            $url = URLBuilder::buildRequest('setup', $_REQUEST['openid_user_setup_url'], $_SESSION['openid']['delegate'], $_SESSION['openid']['identity'], URLBuilder::getCurrentURL(), $handle);
            URLBuilder::doRedirect($url);
        }
    }
}
開發者ID:jvinet,項目名稱:pronto,代碼行數:42,代碼來源:processor.php

示例2: processSetupRequest

/**
 * Processes a response where the provider is requesting to interact with the
 * user in order to confirm their identity.
 */
function processSetupRequest()
{
    if (defined('OPENID_IMMEDIATE') && OPENID_IMMEDIATE) {
        error('noimmediate', 'Couldn\'t perform immediate auth');
    }
    $handle = getHandle($_SESSION['openid']['endpointUrl']);
    $url = URLBuilder::buildRequest('setup', $_REQUEST['openid_user_setup_url'], $_SESSION['openid']['opLocalId'], $_SESSION['openid']['claimedId'], URLBuilder::getCurrentURL(), $handle);
    URLBuilder::doRedirect($url);
}
開發者ID:emma5021,項目名稱:toba,代碼行數:13,代碼來源:processor.php


注:本文中的URLBuilder::doRedirect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。