diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2018-03-10 19:18:59 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2018-03-10 19:18:59 -0500 |
commit | 8370303a3d5f30b78ae37116ca2df8c7525d9e49 (patch) | |
tree | 3068eded62cf46faf6be67959c546ad4a55176e2 /plugins/openid/lib/Auth/Yadis/Manager.php | |
parent | Update jetpack 5.9 (diff) | |
download | blogs-gentoo-8370303a3d5f30b78ae37116ca2df8c7525d9e49.tar.gz blogs-gentoo-8370303a3d5f30b78ae37116ca2df8c7525d9e49.tar.bz2 blogs-gentoo-8370303a3d5f30b78ae37116ca2df8c7525d9e49.zip |
Update openid 3.4.4
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'plugins/openid/lib/Auth/Yadis/Manager.php')
-rw-r--r-- | plugins/openid/lib/Auth/Yadis/Manager.php | 61 |
1 files changed, 54 insertions, 7 deletions
diff --git a/plugins/openid/lib/Auth/Yadis/Manager.php b/plugins/openid/lib/Auth/Yadis/Manager.php index 8c8c3e5a..8aae2da4 100644 --- a/plugins/openid/lib/Auth/Yadis/Manager.php +++ b/plugins/openid/lib/Auth/Yadis/Manager.php @@ -32,7 +32,7 @@ class Auth_Yadis_PHPSession { * @param string $name The name of the key to retrieve. * @param string $default The optional value to return if the key * is not found in the session. - * @return string $result The key's value in the session or + * @return mixed $result The key's value in the session or * $default if it isn't found. */ function get($name, $default=null) @@ -73,17 +73,21 @@ class Auth_Yadis_PHPSession { * * @package OpenID */ -class Auth_Yadis_SessionLoader { +abstract class Auth_Yadis_SessionLoader { /** * Override this. * * @access private + * @param array $data + * @return bool */ function check($data) { return true; } + public abstract function requiredKeys(); + /** * Given a session data value (an array), this creates an object * (returned by $this->newObject()) whose attributes and values @@ -93,6 +97,8 @@ class Auth_Yadis_SessionLoader { * evaluates to false. * * @access private + * @param array $data + * @return null */ function fromSession($data) { @@ -132,6 +138,8 @@ class Auth_Yadis_SessionLoader { * the original data array before calling $this->newObject($data). * * @access private + * @param array $data + * @return array */ function prepareForLoad($data) { @@ -145,6 +153,8 @@ class Auth_Yadis_SessionLoader { * the object's attributes. * * @access private + * @param array $data + * @return null */ function newObject($data) { @@ -158,6 +168,8 @@ class Auth_Yadis_SessionLoader { * from $obj. * * @access private + * @param object $obj + * @return array */ function toSession($obj) { @@ -181,6 +193,8 @@ class Auth_Yadis_SessionLoader { * Override this. * * @access private + * @param object $obj + * @return array */ function prepareForSave($obj) { @@ -275,10 +289,29 @@ class Auth_Yadis_ManagerLoader extends Auth_Yadis_SessionLoader { */ class Auth_Yadis_Manager { + /** @var string */ + public $starting_url; + + /** @var string */ + public $yadis_url; + + /** @var array */ + public $services; + + /** @var string */ + public $session_key; + + /** @var Auth_OpenID_ServiceEndpoint */ + public $_current; + /** * Intialize a new yadis service manager. * * @access private + * @param string $starting_url + * @param string $yadis_url + * @param array $services + * @param string $session_key */ function __construct($starting_url, $yadis_url, $services, $session_key) @@ -340,6 +373,8 @@ class Auth_Yadis_Manager { /** * @access private + * @param string $url + * @return bool */ function forURL($url) { @@ -371,12 +406,12 @@ class Auth_Yadis_Discovery { /** * @access private */ - var $DEFAULT_SUFFIX = 'auth'; + public $DEFAULT_SUFFIX = 'auth'; /** * @access private */ - var $PREFIX = '_yadis_services_'; + public $PREFIX = '_yadis_services_'; /** * Initialize a discovery object. @@ -404,6 +439,10 @@ class Auth_Yadis_Discovery { /** * Return the next authentication service for the pair of * user_input and session. This function handles fallback. + * + * @param callback $discover_cb + * @param object $fetcher + * @return null|Auth_OpenID_ServiceEndpoint */ function getNextService($discover_cb, $fetcher) { @@ -437,8 +476,9 @@ class Auth_Yadis_Discovery { * most-recently-attempted service from the manager, if one * exists. * - * @param $force True if the manager should be deleted regardless + * @param bool $force True if the manager should be deleted regardless * of whether it's a manager for $this->url. + * @return null|Auth_OpenID_ServiceEndpoint */ function cleanup($force=false) { @@ -465,8 +505,9 @@ class Auth_Yadis_Discovery { /** * @access private * - * @param $force True if the manager should be returned regardless + * @param bool $force True if the manager should be returned regardless * of whether it's a manager for $this->url. + * @return null|Auth_Yadis_Manager */ function getManager($force=false) { @@ -474,6 +515,7 @@ class Auth_Yadis_Discovery { // suffix from the session. $manager_str = $this->session->get($this->getSessionKey()); + /** @var Auth_Yadis_Manager $manager */ $manager = null; if ($manager_str !== null) { @@ -484,10 +526,14 @@ class Auth_Yadis_Discovery { if ($manager && ($manager->forURL($this->url) || $force)) { return $manager; } + return null; } /** * @access private + * @param array $services + * @param null|string $yadis_url + * @return Auth_Yadis_Manager|null */ function createManager($services, $yadis_url = null) { @@ -504,12 +550,13 @@ class Auth_Yadis_Discovery { serialize($loader->toSession($manager))); return $manager; } + return null; } /** * @access private * - * @param $force True if the manager should be deleted regardless + * @param bool $force True if the manager should be deleted regardless * of whether it's a manager for $this->url. */ function destroyManager($force=false) |