當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。