本文整理汇总了PHP中Auth_OpenID_ServiceEndpoint::copy方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth_OpenID_ServiceEndpoint::copy方法的具体用法?PHP Auth_OpenID_ServiceEndpoint::copy怎么用?PHP Auth_OpenID_ServiceEndpoint::copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Auth_OpenID_ServiceEndpoint
的用法示例。
在下文中一共展示了Auth_OpenID_ServiceEndpoint::copy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: complete
/**
* @access private
*/
function _verifyDiscoveryResultsOpenID1($message, $endpoint)
{
$claimed_id = $message->getArg(Auth_OpenID_BARE_NS, $this->openid1_return_to_identifier_name);
if ($endpoint === null && $claimed_id === null) {
return new Auth_OpenID_FailureResponse($endpoint, 'When using OpenID 1, the claimed ID must be supplied, ' . 'either by passing it through as a return_to parameter ' . 'or by using a session, and supplied to the GenericConsumer ' . 'as the argument to complete()');
} else {
if ($endpoint !== null && $claimed_id === null) {
$claimed_id = $endpoint->claimed_id;
}
}
$to_match = new Auth_OpenID_ServiceEndpoint();
$to_match->type_uris = array(Auth_OpenID_TYPE_1_1);
$to_match->local_id = $message->getArg(Auth_OpenID_OPENID1_NS, 'identity');
// Restore delegate information from the initiation phase
$to_match->claimed_id = $claimed_id;
if ($to_match->local_id === null) {
return new Auth_OpenID_FailureResponse($endpoint, "Missing required field openid.identity");
}
$to_match_1_0 = $to_match->copy();
$to_match_1_0->type_uris = array(Auth_OpenID_TYPE_1_0);
if ($endpoint !== null) {
$result = $this->_verifyDiscoverySingle($endpoint, $to_match);
if (is_a($result, 'Auth_OpenID_TypeURIMismatch')) {
$result = $this->_verifyDiscoverySingle($endpoint, $to_match_1_0);
}
if (Auth_OpenID::isFailure($result)) {
// oidutil.log("Error attempting to use stored
// discovery information: " + str(e))
// oidutil.log("Attempting discovery to
// verify endpoint")
} else {
return $endpoint;
}
}
// Endpoint is either bad (failed verification) or None
return $this->_discoverAndVerify($to_match->claimed_id, array($to_match, $to_match_1_0));
}
示例2: complete
/**
* @access private
*/
function _verifyDiscoveryResultsOpenID1($message, $endpoint)
{
if ($endpoint === null) {
return new Auth_OpenID_FailureResponse($endpoint, 'When using OpenID 1, the claimed ID must be supplied, ' . 'either by passing it through as a return_to parameter ' . 'or by using a session, and supplied to the GenericConsumer ' . 'as the argument to complete()');
}
$to_match = new Auth_OpenID_ServiceEndpoint();
$to_match->type_uris = array(Auth_OpenID_TYPE_1_1);
$to_match->local_id = $message->getArg(Auth_OpenID_OPENID1_NS, 'identity');
// Restore delegate information from the initiation phase
$to_match->claimed_id = $endpoint->claimed_id;
if ($to_match->local_id === null) {
return new Auth_OpenID_FailureResponse($endpoint, "Missing required field openid.identity");
}
$to_match_1_0 = $to_match->copy();
$to_match_1_0->type_uris = array(Auth_OpenID_TYPE_1_0);
$result = $this->_verifyDiscoverySingle($endpoint, $to_match);
if (is_a($result, 'Auth_OpenID_TypeURIMismatch')) {
$result = $this->_verifyDiscoverySingle($endpoint, $to_match_1_0);
}
if (Auth_OpenID::isFailure($result)) {
return $result;
} else {
return $endpoint;
}
}