本文整理汇总了PHP中URLBuilder::buildRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP URLBuilder::buildRequest方法的具体用法?PHP URLBuilder::buildRequest怎么用?PHP URLBuilder::buildRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URLBuilder
的用法示例。
在下文中一共展示了URLBuilder::buildRequest方法的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);
}
}
}
示例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);
}