diff options
author | tailor <cygnus@cprogrammer.org> | 2007-11-13 02:42:22 +0000 |
---|---|---|
committer | tailor <cygnus@cprogrammer.org> | 2007-11-13 02:42:22 +0000 |
commit | 6bc772385bd9134d054b816fee8f2f19bb3a55df (patch) | |
tree | f2da6deb7dab2f2b25252777b395724fe12949f7 /Auth | |
parent | 1f45f3f6f4b2691b8697fb52525cba2f79df7862 (diff) | |
download | php-openid-6bc772385bd9134d054b816fee8f2f19bb3a55df.zip php-openid-6bc772385bd9134d054b816fee8f2f19bb3a55df.tar.gz php-openid-6bc772385bd9134d054b816fee8f2f19bb3a55df.tar.bz2 |
[project @ [API CHANGE] Make return_to no longer optional for complete() calls to consumer]
Diffstat (limited to 'Auth')
-rw-r--r-- | Auth/OpenID.php | 2 | ||||
-rw-r--r-- | Auth/OpenID/Association.php | 1 | ||||
-rw-r--r-- | Auth/OpenID/Consumer.php | 9 |
3 files changed, 7 insertions, 5 deletions
diff --git a/Auth/OpenID.php b/Auth/OpenID.php index 51f655e..1d01d44 100644 --- a/Auth/OpenID.php +++ b/Auth/OpenID.php @@ -139,6 +139,8 @@ class Auth_OpenID { { if ($query_str !== null) { $str = $query_str; + } else if (!array_key_exists('REQUEST_METHOD', $_SERVER)) { + $str = ""; } else if ($_SERVER['REQUEST_METHOD'] == 'GET') { $str = $_SERVER['QUERY_STRING']; } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { diff --git a/Auth/OpenID/Association.php b/Auth/OpenID/Association.php index b77ac84..1bfe403 100644 --- a/Auth/OpenID/Association.php +++ b/Auth/OpenID/Association.php @@ -518,6 +518,7 @@ function &Auth_OpenID_getEncryptedNegotiator() class Auth_OpenID_SessionNegotiator { function Auth_OpenID_SessionNegotiator($allowed_types) { + $this->allowed_types = array(); $this->setAllowedTypes($allowed_types); } diff --git a/Auth/OpenID/Consumer.php b/Auth/OpenID/Consumer.php index 13b0b12..1be259b 100644 --- a/Auth/OpenID/Consumer.php +++ b/Auth/OpenID/Consumer.php @@ -399,7 +399,7 @@ class Auth_OpenID_Consumer { * indicated by the status attribute, which will be one of * SUCCESS, CANCEL, FAILURE, or SETUP_NEEDED. */ - function complete($query=null, $return_to=null) + function complete($return_to, $query=null) { if ($query === null) { $query = Auth_OpenID::getQuery(); @@ -633,7 +633,7 @@ class Auth_OpenID_GenericConsumer { * * @access private */ - function complete($message, $endpoint, $return_to = null) + function complete($message, $endpoint, $return_to) { $mode = $message->getArg(Auth_OpenID_OPENID_NS, 'mode', '<no mode set>'); @@ -729,8 +729,7 @@ class Auth_OpenID_GenericConsumer { return $result; } - if (($return_to !== null) && - (!$this->_checkReturnTo($message, $return_to))) { + if (!$this->_checkReturnTo($message, $return_to)) { return new Auth_OpenID_FailureResponse(null, sprintf("return_to does not match return URL. Expected %s, got %s", $return_to, @@ -847,7 +846,7 @@ class Auth_OpenID_GenericConsumer { // XXX: this should be checked by _idResCheckForFields if (!$return_to) { return new Auth_OpenID_FailureResponse(null, - "no openid.return_to in query"); + "Response has no return_to"); } $parsed_url = parse_url($return_to); |