(Tips) Defaulting to OpenID on Drupal 5

Tips : Defaulting to OpenID on Drupal 5

Step 1: Override Authentication UI

First I added the following overrides in my theme's template.php file to specifiy that I would be overriding various interface elements.

// override the user log in form at /user
function phptemplate_user_login($form) {
  return _phptemplate_callback('user_login', array('form' => $form));
}

// override the user registration form at /user/register
function phptemplate_user_register($form) {
  return _phptemplate_callback('user_register', array('form' => $form));
}

// override the password reset form at /user/password
function phptemplate_user_pass($form) {
  return _phptemplate_callback('user_pass', array('form' => $form));
}

// override the user log in block
function phptemplate_user_login_block($form) {
  // show hint in form element
  $form['openid_url']['#value'] = 'OpenID Login';
  // remove hint in form element on focus
  $form['openid_url']['#attributes'] = array('onfocus' => "javascript:openid_url.value=''");
  return _phptemplate_callback('user_login_block', array('form' => $form));
}

Step 2: New User Log In Template

Next I added a template file to my theme directory called "user_login.tpl.php" as per my override in template.php above with the following code.

[Read more..]

Courtesy : http://xolotl.org