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. --- start.php | 60 +++++++----------------------------------------------------- 1 file changed, 7 insertions(+), 53 deletions(-) (limited to 'start.php') diff --git a/start.php b/start.php index 82dcd5c11..1bf85eb74 100644 --- a/start.php +++ b/start.php @@ -15,7 +15,6 @@ function openid_client_init() { elgg_extend_view('css/elgg', 'openid_client/css'); elgg_extend_view('js/elgg', 'openid_client/js'); - elgg_extend_view('core/account/login_box', 'openid_client/login'); elgg_register_plugin_hook_handler('register', 'menu:openid_login', 'openid_client_setup_menu'); $base = elgg_get_plugins_path() . 'openid_client/actions/openid_client'; @@ -24,6 +23,13 @@ function openid_client_init() { $base = elgg_get_plugins_path() . 'openid_client/lib'; elgg_register_library('openid_client', "$base/helpers.php"); + + elgg_set_config('openid_providers', array( + 'N-1' => 'https://n-1.cc/openid/', + 'Ecoxarxes' => 'https://cooperativa.ecoxarxes.cat/openid/', + 'Anillosur' => 'https://anillosur.cc/openid/', + // ... + )); // don't let OpenID users set their passwords elgg_register_event_handler('pagesetup', 'system', 'openid_client_remove_password'); @@ -47,58 +53,6 @@ function openid_client_set_subtype($user) { update_data($query); } -/** - * Register login options - * - * @param string $hook - * @param string $type - * @param array $menu - * @param array $params - * @return array - */ -function openid_client_setup_menu($hook, $type, $menu, $params) { - - $items = array( - 'large' => array( - 'google' => '', - 'yahoo' => '', - ), - 'small' => array( - 'blogger' => 'toggle', - 'wordpress' => 'toggle', - ), - ); - $items = elgg_trigger_plugin_hook('register', 'openid_client:login', null, $items); - - $priority = 100; - foreach ($items as $type => $providers) { - foreach ($providers as $provider => $toggle) { - $provider_name = elgg_echo("openid_client:provider:$provider"); - - $options = array( - 'name' => $provider, - 'text' => '', - 'title' => elgg_echo('openid_client:login:instructs', array($provider_name)), - 'href' => "action/openid_client/login?openid_provider=$provider", - 'is_action' => true, - 'section' => $type, - 'priority' => $priority, - ); - - if ($toggle) { - $options['link_class'] = 'openid-client-toggle'; - $options['rel'] = $provider; - } - - $menu[] = ElggMenuItem::factory($options); - - $priority += 10; - } - } - - return $menu; -} - /** * Remove the password view from the account settings form */ -- cgit v1.2.3