aboutsummaryrefslogtreecommitdiff
path: root/actions/openid_client
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-09-22 05:06:19 +0200
committerSem <sembrestels@riseup.net>2012-09-22 05:06:19 +0200
commite69825051c3d19f188e68801ba945c1cd8b8cfdd (patch)
tree356d890af39dc2798ceb3b83e79a2078062d6b5e /actions/openid_client
parent1c1fe3b50e5a3297115c57543932a210d585a539 (diff)
downloadelgg-e69825051c3d19f188e68801ba945c1cd8b8cfdd.tar.gz
elgg-e69825051c3d19f188e68801ba945c1cd8b8cfdd.tar.bz2
Removed comercial openid providers and refactored openid login form.
Diffstat (limited to 'actions/openid_client')
-rw-r--r--actions/openid_client/login.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/actions/openid_client/login.php b/actions/openid_client/login.php
index cf991ea0f..604374ced 100644
--- a/actions/openid_client/login.php
+++ b/actions/openid_client/login.php
@@ -6,11 +6,13 @@
elgg_load_library('openid_consumer');
$provider = get_input('openid_provider');
-$username = get_input('openid_username');
+
+if ($provider == 'others') {
+ $provider = get_input('openid_url');
+}
$consumer = new ElggOpenIDConsumer($store);
-$consumer->setProvider($provider);
-$consumer->setUsername($username);
+$consumer->setURL($provider);
$consumer->setReturnURL(elgg_get_site_url() . 'mod/openid_client/return.php');
$html = $consumer->requestAuthentication();
@@ -18,7 +20,12 @@ if ($html) {
echo $html;
exit;
} else {
- $provider_name = elgg_echo("openid_client:provider:$provider");
+ $flipped_providers = array_flip(elgg_get_config('openid_providers'));
+ if (isset($flipped_providers[$provider])) {
+ $provider_name = $flipped_providers[$provider];
+ } else {
+ $provider_name = $provider;
+ }
register_error(elgg_echo('openid_client:error:no_html', array($provider_name)));
forward();
}