getGUID(); $subtype_id = (int)add_subtype('user', 'openid'); $query = "UPDATE {$db_prefix}entities SET subtype = $subtype_id WHERE guid = $guid"; 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', 'wordpress'), ); $items = elgg_trigger_plugin_hook('register', 'openid_login', null, $items); $priority = 100; foreach ($items as $type => $providers) { foreach ($providers as $provider) { $provider_name = elgg_echo("openid_client:provider:$provider"); $menu[] = ElggMenuItem::factory(array( 'name' => $provider, 'text' => '', 'title' => elgg_echo('openid_client:login:instructs', array($provider_name)), 'href' => "action/openid_client/login?provider=$provider", 'is_action' => true, 'section' => $type, 'priority' => $priority, )); $priority += 10; } } return $menu; } /** * OpenID client page handler * * @param type $page Array of URL segments * @return bool */ function openid_client_page_handler($page) { // this is test code for right now elgg_load_library('openid_client'); openid_client_registration_page_handler(array( 'username' => 'john', 'email' => 'john@example.org', 'name' => 'John Doe', 'openid_identifier' => 'abcdefghijklmnopqrstuvwxyz', )); return true; }