aboutsummaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-12-17 15:55:57 -0500
committercash <cash.costello@gmail.com>2011-12-17 15:55:57 -0500
commit6f51b4a2ce1b7945ca5b02c5a00a701eb985c3f0 (patch)
tree86b170239a75f282e95cfeba49b0fb6262d8d731 /classes
parent4c677d75bef1f2e6c99e040ed79c712adf4262eb (diff)
downloadelgg-6f51b4a2ce1b7945ca5b02c5a00a701eb985c3f0.tar.gz
elgg-6f51b4a2ce1b7945ca5b02c5a00a701eb985c3f0.tar.bz2
fixed issues preventing account creation
Diffstat (limited to 'classes')
-rw-r--r--classes/ElggOpenIDConsumer.php48
1 files changed, 43 insertions, 5 deletions
diff --git a/classes/ElggOpenIDConsumer.php b/classes/ElggOpenIDConsumer.php
index 6e6828e1c..864e47d41 100644
--- a/classes/ElggOpenIDConsumer.php
+++ b/classes/ElggOpenIDConsumer.php
@@ -6,6 +6,7 @@
class ElggOpenIDConsumer {
protected $provider;
+ protected $username;
protected $returnURL;
protected $store;
@@ -36,6 +37,15 @@ class ElggOpenIDConsumer {
}
/**
+ * Set the OpenID username
+ *
+ * @param string $username
+ */
+ public function setUsername($username) {
+ $this->username = $username;
+ }
+
+ /**
* Set the return URL
*
* @param string $url The URL the OpenID provider returns the user to
@@ -119,11 +129,39 @@ class ElggOpenIDConsumer {
*/
protected function getProviderURL() {
$url = null;
- switch ($this->provider) {
+ $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':
+ $url = "";
+ break;
+ case 'aol':
+ $url = "http://openid.aol.com/$username";
+ break;
+ case 'verisign':
+ $url = "http://username.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;
}
@@ -199,7 +237,7 @@ class ElggOpenIDConsumer {
$data = $this->extractUserData($sreg, $ax);
$data['openid_identifier'] = $response->getDisplayIdentifier();
- return data;
+ return $data;
}
/**
@@ -217,7 +255,7 @@ class ElggOpenIDConsumer {
$data['email'] = $sreg['email'];
}
if (isset($ax['http://axschema.org/contact/email'])) {
- $data['email'] = $ax['http://axschema.org/contact/email'];
+ $data['email'] = $ax['http://axschema.org/contact/email'][0];
}
// display name
@@ -225,10 +263,10 @@ class ElggOpenIDConsumer {
$data['name'] = $sreg['fullname'];
}
if (isset($ax['http://axschema.org/namePerson/first'])) {
- $data['name'] = $ax['http://axschema.org/namePerson/first'];
+ $data['name'] = $ax['http://axschema.org/namePerson/first'][0];
}
if (isset($ax['http://axschema.org/namePerson/last'])) {
- $data['name'] .= ' ' . $ax['http://axschema.org/namePerson/last'];
+ $data['name'] .= ' ' . $ax['http://axschema.org/namePerson/last'][0];
$data['name'] = trim($data['name']);
}