diff options
author | Sem <sembrestels@riseup.net> | 2012-09-22 05:06:19 +0200 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-09-22 05:06:19 +0200 |
commit | e69825051c3d19f188e68801ba945c1cd8b8cfdd (patch) | |
tree | 356d890af39dc2798ceb3b83e79a2078062d6b5e /classes/ElggOpenIDConsumer.php | |
parent | 1c1fe3b50e5a3297115c57543932a210d585a539 (diff) | |
download | elgg-e69825051c3d19f188e68801ba945c1cd8b8cfdd.tar.gz elgg-e69825051c3d19f188e68801ba945c1cd8b8cfdd.tar.bz2 |
Removed comercial openid providers and refactored openid login form.
Diffstat (limited to 'classes/ElggOpenIDConsumer.php')
-rw-r--r-- | classes/ElggOpenIDConsumer.php | 68 |
1 files changed, 4 insertions, 64 deletions
diff --git a/classes/ElggOpenIDConsumer.php b/classes/ElggOpenIDConsumer.php index 3918086ab..098201343 100644 --- a/classes/ElggOpenIDConsumer.php +++ b/classes/ElggOpenIDConsumer.php @@ -5,8 +5,7 @@ class ElggOpenIDConsumer { - protected $provider; - protected $username; + protected $openIdUrl; protected $returnURL; protected $store; @@ -28,21 +27,12 @@ class ElggOpenIDConsumer { } /** - * Set the name of the OpenID provider - * - * @param string $provider - */ - public function setProvider($provider) { - $this->provider = $provider; - } - - /** * Set the OpenID username * * @param string $username */ - public function setUsername($username) { - $this->username = $username; + public function setURL($url) { + $this->openIdUrl = $url; } /** @@ -70,7 +60,7 @@ class ElggOpenIDConsumer { return false; } - $url = $this->getProviderURL(); + $url = $this->openIdUrl; if (!$url) { return false; } @@ -123,56 +113,6 @@ class ElggOpenIDConsumer { } /** - * Get the OpenID provider URL based on name - * - * @return string - */ - protected function getProviderURL() { - $url = null; - $provider = $this->provider; - $username = $this->username; - switch ($provider) { - case 'google': - $url = 'https://www.google.com/accounts/o8/id'; - break; - case 'yahoo': - $url = 'https://me.yahoo.com/'; - break; - case 'blogger': - $url = "http://$username.blogspot.com/"; - break; - case 'wordpress': - // username is actually the blog name - $url = "http://$username.wordpress.com/"; - break; - case 'livejournal': - $url = "http://$username.livejournal.com/"; - break; - case 'aol': - $url = "https://openid.aol.com/"; - break; - case 'verisign': - $url = "https://pip.verisignlabs.com/ "; - break; - case 'myopenid': - $url = 'https://myopenid.com/'; - break; - case 'myspace': - $url = 'https://api.myspace.com/openid'; - break; - default: - $params = array( - 'provider' => $provider, - 'username' => $username, - ); - $url = elgg_trigger_plugin_hook('set', 'openid_client:url', $params); - break; - } - - return $url; - } - - /** * Add attribute requests to the OpenID authentication request * * @return bool |