mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
c6a0bf260a
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41771 467b73ca-7a2a-4603-9d3b-597d59a354a9
58 lines
1.2 KiB
PHP
58 lines
1.2 KiB
PHP
<?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;
|
|
}
|
|
}
|
|
|
|
?>
|