aboutsummaryrefslogtreecommitdiff
path: root/models/Auth.old/OpenID/Extension.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-12-11 06:38:23 -0500
committerCash Costello <cash.costello@gmail.com>2011-12-11 06:38:23 -0500
commitd9bf22a0e29c2a70049443a0ae8521a2c0492c8b (patch)
treec7599a9169d5def7df56c480ad6d67f312443d6f /models/Auth.old/OpenID/Extension.php
downloadelgg-d9bf22a0e29c2a70049443a0ae8521a2c0492c8b.tar.gz
elgg-d9bf22a0e29c2a70049443a0ae8521a2c0492c8b.tar.bz2
initial commit for git repository
Diffstat (limited to 'models/Auth.old/OpenID/Extension.php')
-rw-r--r--models/Auth.old/OpenID/Extension.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/models/Auth.old/OpenID/Extension.php b/models/Auth.old/OpenID/Extension.php
new file mode 100644
index 000000000..73b5d502e
--- /dev/null
+++ b/models/Auth.old/OpenID/Extension.php
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * An interface for OpenID extensions.
+ *
+ * @package OpenID
+ */
+
+/**
+ * Require the Message implementation.
+ */
+require_once 'Auth/OpenID/Message.php';
+
+/**
+ * A base class for accessing extension request and response data for
+ * the OpenID 2 protocol.
+ *
+ * @package OpenID
+ */
+class Auth_OpenID_Extension {
+ /**
+ * ns_uri: The namespace to which to add the arguments for this
+ * extension
+ */
+ var $ns_uri = null;
+ var $ns_alias = null;
+
+ /**
+ * Get the string arguments that should be added to an OpenID
+ * message for this extension.
+ */
+ function getExtensionArgs()
+ {
+ return null;
+ }
+
+ /**
+ * Add the arguments from this extension to the provided message.
+ *
+ * Returns the message with the extension arguments added.
+ */
+ function toMessage(&$message)
+ {
+ if ($message->namespaces->addAlias($this->ns_uri,
+ $this->ns_alias) === null) {
+ if ($message->namespaces->getAlias($this->ns_uri) !=
+ $this->ns_alias) {
+ return null;
+ }
+ }
+
+ $message->updateArgs($this->ns_uri,
+ $this->getExtensionArgs());
+ return $message;
+ }
+}
+
+?> \ No newline at end of file