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


PHP Auth_OpenID_Message::updateArgs方法代码示例

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


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

示例1: encodeToURL

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

		// Imported from the alternate reality where these classes are
		// used in both the client and server code, so Requests are
		// Encodable too.  That's right, code imported from alternate
		// realities all for the love of you, id_res/user_setup_url.

		$q = array('mode' => $this->mode,
                   'identity' => $this->identity,
                   'claimed_id' => $this->claimed_id,
                   'return_to' => $this->return_to);

		if ($this->trust_root) {
			if ($this->message->isOpenID1()) {
				$q['trust_root'] = $this->trust_root;
			} else {
				$q['realm'] = $this->trust_root;
			}
		}

		if ($this->assoc_handle) {
			$q['assoc_handle'] = $this->assoc_handle;
		}

		$response = new Auth_OpenID_Message(
		$this->message->getOpenIDNamespace());
		$response->updateArgs(Auth_OpenID_OPENID_NS, $q);
		return $response->toURL($server_url);
	}
开发者ID:hoalangoc,项目名称:ftf,代码行数:33,代码来源:Server.php

示例2: array

 function _test($uri)
 {
     // Create a request message with simple registration fields
     $sreg_req = Auth_OpenID_SRegRequest::build(array('nickname', 'email'), array('fullname'));
     $req_msg = new Auth_OpenID_Message($uri);
     $req_msg->updateArgs(Auth_OpenID_SREG_NS_URI, $sreg_req->getExtensionArgs());
     $req = new Auth_OpenID_Request();
     $req->message =& $req_msg;
     $req->namespace = $req_msg->getOpenIDNamespace();
     // -> send checkid_* request
     // Create an empty response message
     $resp_msg = new Auth_OpenID_Message($uri);
     $resp = new Auth_OpenID_ServerResponse($req);
     $resp->fields = $resp_msg;
     $data = array('nickname' => 'linusaur', 'postcode' => '12345', 'country' => 'US', 'gender' => 'M', 'fullname' => 'Leonhard Euler', 'email' => 'president@whitehouse.gov', 'dob' => '0000-00-00', 'language' => 'en-us');
     // Put the requested data fields in the response message
     $sreg_resp = Auth_OpenID_SRegResponse::extractResponse($sreg_req, $data);
     $resp->addExtension($sreg_resp);
     // <- send id_res response
     // Extract the fields that were sent
     $sreg_data_resp = $resp->fields->getArgs(Auth_OpenID_SREG_NS_URI);
     $this->assertEquals(array('nickname' => 'linusaur', 'email' => 'president@whitehouse.gov', 'fullname' => 'Leonhard Euler'), $sreg_data_resp);
 }
开发者ID:BGCX067,项目名称:ezopenid-svn-to-git,代码行数:23,代码来源:SReg.php


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