aboutsummaryrefslogtreecommitdiff
path: root/classes/ElggOpenIDConsumer.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/ElggOpenIDConsumer.php')
-rw-r--r--classes/ElggOpenIDConsumer.php68
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