From e69825051c3d19f188e68801ba945c1cd8b8cfdd Mon Sep 17 00:00:00 2001 From: Sem Date: Sat, 22 Sep 2012 05:06:19 +0200 Subject: Removed comercial openid providers and refactored openid login form. --- classes/ElggOpenIDConsumer.php | 68 +++--------------------------------------- 1 file changed, 4 insertions(+), 64 deletions(-) (limited to 'classes/ElggOpenIDConsumer.php') 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; @@ -27,22 +26,13 @@ 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; } @@ -122,56 +112,6 @@ class ElggOpenIDConsumer { return $data; } - /** - * 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 * -- cgit v1.2.3