当前位置: 首页>>代码示例>>PHP>>正文


PHP Auth_OpenID_Message::setArg方法代码示例

本文整理汇总了PHP中Auth_OpenID_Message::setArg方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth_OpenID_Message::setArg方法的具体用法?PHP Auth_OpenID_Message::setArg怎么用?PHP Auth_OpenID_Message::setArg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Auth_OpenID_Message的用法示例。


在下文中一共展示了Auth_OpenID_Message::setArg方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCancelURL

	function getCancelURL()
	{
		if (!$this->return_to) {
			return new Auth_OpenID_NoReturnToError();
		}

		if ($this->immediate) {
			return new Auth_OpenID_ServerError(null,
                                               "Cancel is not an appropriate \
                                               response to immediate mode \
                                               requests.");
		}

		$response = new Auth_OpenID_Message(
		$this->message->getOpenIDNamespace());
		$response->setArg(Auth_OpenID_OPENID_NS, 'mode', 'cancel');
		return $response->toURL($this->return_to);
	}
开发者ID:hoalangoc,项目名称:ftf,代码行数:18,代码来源:Server.php

示例2: testUnsupportedWithRetry

 function testUnsupportedWithRetry()
 {
     $msg = new Auth_OpenID_Message($this->endpoint->preferredNamespace());
     $msg->setArg(Auth_OpenID_OPENID_NS, 'error', 'Unsupported type');
     $msg->setArg(Auth_OpenID_OPENID_NS, 'error_code', 'unsupported-type');
     $msg->setArg(Auth_OpenID_OPENID_NS, 'assoc_type', 'HMAC-SHA1');
     $msg->setArg(Auth_OpenID_OPENID_NS, 'session_type', 'DH-SHA1');
     $assoc = new Auth_OpenID_Association('handle', 'secretxx', 'issued', 10000, 'HMAC-SHA1');
     $this->consumer->return_messages = array($assoc, $msg);
     $result = $this->consumer->_negotiateAssociation($this->endpoint);
     $this->assertTrue($result === null);
     // $this->failUnlessLogMatches('Server error when requesting an association')
 }
开发者ID:openid,项目名称:php-openid,代码行数:13,代码来源:Negotiation.php

示例3: array

 function test_completeGoodReturnTo()
 {
     // Test GenericConsumer.complete()'s handling of good
     // return_to values.
     $return_to = "http://some.url/path";
     $good_return_tos = array(array($return_to, array()), array($return_to . "?another=arg", array(array(array(Auth_OpenID_BARE_NS, 'another'), 'arg'))), array($return_to . "?another=arg#fragment", array(array(array(Auth_OpenID_BARE_NS, 'another'), 'arg'))), array("HTTP://some.url/path", array()), array("http://some.URL/path", array()), array("http://some.url:80/path", array()), array("http://some.url/./path", array()));
     $endpoint = null;
     foreach ($good_return_tos as $pair) {
         list($good_return_to, $extra) = $pair;
         $m = new Auth_OpenID_Message(Auth_OpenID_OPENID1_NS);
         $m->setArg(Auth_OpenID_OPENID_NS, 'mode', 'cancel');
         for ($i = 0; $i < count($extra); $i++) {
             list($ckey, $value) = $extra[$i];
             $ns = $ckey[0];
             $key = $ckey[1];
             $m->setArg($ns, $key, $value);
         }
         $m->setArg(Auth_OpenID_OPENID_NS, 'return_to', $good_return_to);
         $result = $this->consumer->complete($m, $endpoint, $return_to);
         $this->assertTrue(is_a($result, 'Auth_OpenID_CancelResponse'));
     }
 }
开发者ID:umbecr,项目名称:camilaframework,代码行数:22,代码来源:Consumer.php

示例4:

 function test_trustRootOpenID2()
 {
     // Ignore openid.trust_root in OpenID 2
     $msg = new Auth_OpenID_Message(Auth_OpenID_OPENID2_NS);
     $msg->setArg(Auth_OpenID_OPENID_NS, 'mode', 'checkid_setup');
     $msg->setArg(Auth_OpenID_OPENID_NS, 'realm', 'http://real_trust_root/');
     $msg->setArg(Auth_OpenID_OPENID_NS, 'trust_root', 'http://fake_trust_root/');
     $msg->setArg(Auth_OpenID_OPENID_NS, 'return_to', 'http://real_trust_root/foo');
     $msg->setArg(Auth_OpenID_OPENID_NS, 'assoc_handle', 'bogus');
     $msg->setArg(Auth_OpenID_OPENID_NS, 'identity', 'george');
     $msg->setArg(Auth_OpenID_OPENID_NS, 'claimed_id', 'george');
     $result = Auth_OpenID_CheckIDRequest::fromMessage($msg, $this->server);
     $this->assertTrue($result->trust_root == 'http://real_trust_root/');
 }
开发者ID:alexandreeffetb,项目名称:yos-social-php5,代码行数:14,代码来源:Server.php


注:本文中的Auth_OpenID_Message::setArg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。