summaryrefslogtreecommitdiffstats
path: root/Auth
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-02-06 20:04:23 +0000
committertailor <cygnus@janrain.com>2007-02-06 20:04:23 +0000
commitade56d554a4a288eca2ff30de5d18c0632187e99 (patch)
tree1c202bef614f8a53e0f6a5fc11a0694137be37a8 /Auth
parentd27d6a4d1a929093b4702e5f3fff84bb70e79eaa (diff)
downloadphp-openid-ade56d554a4a288eca2ff30de5d18c0632187e99.zip
php-openid-ade56d554a4a288eca2ff30de5d18c0632187e99.tar.gz
php-openid-ade56d554a4a288eca2ff30de5d18c0632187e99.tar.bz2
[project @ Added more negotiation tests]
Diffstat (limited to 'Auth')
-rw-r--r--Auth/OpenID/Server.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/Auth/OpenID/Server.php b/Auth/OpenID/Server.php
index 3dbf194..01a1268 100644
--- a/Auth/OpenID/Server.php
+++ b/Auth/OpenID/Server.php
@@ -145,10 +145,13 @@ class Auth_OpenID_ServerError {
/**
* @access private
*/
- function Auth_OpenID_ServerError($message = null, $text = null)
+ function Auth_OpenID_ServerError($message = null, $text = null,
+ $reference = null, $contact = null)
{
$this->message = $message;
$this->text = $text;
+ $this->contact = $contact;
+ $this->reference = $reference;
}
/**
@@ -200,6 +203,26 @@ class Auth_OpenID_ServerError {
'error' => $this->toString()));
}
+ function toMessage()
+ {
+ // Generate a Message object for sending to the relying party,
+ // after encoding.
+ $namespace = $this->message->getOpenIDNamespace();
+ $reply = new Auth_OpenID_Message($namespace);
+ $reply->setArg(Auth_OpenID_OPENID_NS, 'mode', 'error');
+ $reply->setArg(Auth_OpenID_OPENID_NS, 'error', $this->toString());
+
+ if ($this->contact !== null) {
+ $reply->setArg(Auth_OpenID_OPENID_NS, 'contact', $this->contact);
+ }
+
+ if ($this->reference !== null) {
+ $reply->setArg(Auth_OpenID_OPENID_NS, 'reference', $this->reference);
+ }
+
+ return $reply;
+ }
+
/**
* Returns one of $_Auth_OpenID_Encode_Url,
* $_Auth_OpenID_Encode_Kvform, or null, depending on the type of