本文整理汇总了PHP中Auth_OpenID_TrustRoot::match方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth_OpenID_TrustRoot::match方法的具体用法?PHP Auth_OpenID_TrustRoot::match怎么用?PHP Auth_OpenID_TrustRoot::match使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Auth_OpenID_TrustRoot
的用法示例。
在下文中一共展示了Auth_OpenID_TrustRoot::match方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trustRootValid
function trustRootValid()
{
if (!$this->trust_root) {
return true;
}
$tr = Auth_OpenID_TrustRoot::_parse($this->trust_root);
if ($tr === false) {
return new Auth_OpenID_MalformedTrustRoot($this->message,
$this->trust_root);
}
if ($this->return_to !== null) {
return Auth_OpenID_TrustRoot::match($this->trust_root,
$this->return_to);
} else {
return true;
}
}
示例2: Auth_OpenID_AX_FetchRequest
/**
* Extract a FetchRequest from an OpenID message
*
* @param request: The OpenID request containing the attribute
* fetch request
*
* @returns mixed An Auth_OpenID_AX_Error or the
* Auth_OpenID_AX_FetchRequest extracted from the request message if
* successful
*/
function &fromOpenIDRequest($request)
{
$m = $request->message;
$obj = new Auth_OpenID_AX_FetchRequest();
$ax_args = $m->getArgs($obj->ns_uri);
$result = $obj->parseExtensionArgs($ax_args);
if (Auth_OpenID_AX::isError($result)) {
return $result;
}
if ($obj->update_url) {
// Update URL must match the openid.realm of the
// underlying OpenID 2 message.
$realm = $m->getArg(Auth_OpenID_OPENID_NS, 'realm', $m->getArg(Auth_OpenID_OPENID_NS, 'return_to'));
if (!$realm) {
$obj = new Auth_OpenID_AX_Error(sprintf("Cannot validate update_url %s " . "against absent realm", $obj->update_url));
} else {
if (!Auth_OpenID_TrustRoot::match($realm, $obj->update_url)) {
$obj = new Auth_OpenID_AX_Error(sprintf("Update URL %s failed validation against realm %s", $obj->update_url, $realm));
}
}
}
return $obj;
}
示例3: Auth_OpenID_returnToMatches
function Auth_OpenID_returnToMatches($allowed_return_to_urls, $return_to)
{
foreach ($allowed_return_to_urls as $allowed_return_to) {
// A return_to pattern works the same as a realm, except that
// it's not allowed to use a wildcard. We'll model this by
// parsing it as a realm, and not trying to match it if it has
// a wildcard.
$return_realm = Auth_OpenID_TrustRoot::_parse($allowed_return_to);
if ($return_realm !== false && !$return_realm['wildcard'] && Auth_OpenID_TrustRoot::match($allowed_return_to, $return_to)) {
return true;
}
}
// No URL in the list matched
return false;
}
示例4: runTest
function runTest()
{
$matches = Auth_OpenID_TrustRoot::match($this->tr, $this->rt);
$this->assertEquals((bool) $this->matches, (bool) $matches);
}