=') && version_compare($wp_version, '2.6', '<')) {
add_action( 'init', 'wp25_login_openid' );
}
/**
* If we're doing openid authentication ($_POST['openid_identifier'] is set), start the consumer & redirect
* Otherwise, return and let WordPress handle the login and/or draw the form.
*
* @param string $credentials username and password provided in login form
*/
function openid_wp_authenticate(&$credentials) {
if (!empty($_POST['openid_identifier'])) {
$finish_url = $_REQUEST['redirect_to'];
openid_start_login($_POST['openid_identifier'], 'login', $finish_url);
// if we got this far, something is wrong
global $error;
$error = openid_message();
}
}
/**
* Setup OpenID errors to be displayed to the user.
*/
function openid_login_errors() {
$self = basename( $GLOBALS['pagenow'] );
if ($self != 'wp-login.php') return;
if ($_REQUEST['openid_error']) {
global $error;
$error = htmlentities2($_REQUEST['openid_error']);
}
if ($_REQUEST['registration_closed']) {
global $error;
$error = __('Your have entered a valid OpenID, but this site is not currently accepting new accounts.', 'openid');
}
}
/**
* Add style and script to login page.
*/
function openid_wp_login_head() {
openid_style();
wp_enqueue_script('jquery.xpath', openid_plugin_url() . '/f/jquery.xpath.min.js',
array('jquery'), OPENID_PLUGIN_REVISION);
wp_print_scripts(array('jquery.xpath'));
}
/**
* Add OpenID input field to wp-login.php
*
* @action: login_form
**/
function openid_wp_login_form() {
global $wp_version;
echo '
';
}
/**
* Add information about registration to wp-login.php?action=register
*
* @action: register_form
**/
function openid_wp_register_form() {
global $wp_version;
echo '
'; //Added to fix IE problem
if (get_option('openid_required_for_registration')) {
$label = __('Register using an OpenID:', 'openid');
echo '
';
} else {
$label = __('Or register using an OpenID:', 'openid');
echo '';
echo '
';
}
echo '