It would be nice to be able to specify whether or not you want the OpenID login or the Drupal login as the default state for the Login block.

Comments

blakehall’s picture

I'll second the request for this.

I had to remove the user_login_block from openid_form_alter since it wasn't working.

It would be nice to add an admin settings page with configurable options. Are there other options that would be useful at admin/settings?

kmv’s picture

This is straying from the original request, but yeah:

  • Default role (I think there is a patch floating about for this)
  • Option to add an OpenID login bar to comment entry (like LiveJournal comments)
dag-’s picture

I have been hacking my own OpenID field as a block. Although I almost got there using the normal functionality and drupal_get_form() I was not able to mimic the behaviour like after an openid_form_alter(). I ended up adding a HTML block that was produced after Firefox's "View selected source" after I performed the openid_form_alter().

I am not sure why the following code as a block is not correctly working on Drupal6 though:

<?php
function openid_login_block() {
  $form = array(
    '#action' => url($_GET['q'], array('query' => drupal_get_destination())),
    '#id' => 'user-login-form',
    '#validate' => array('openid_login_validate'),
  );
  $form['openid_identifier'] = array(
    '#type' => 'textfield',
    '#title' => t('Log in using OpenID'),
    '#size' => 14,
    '#required' => TRUE,
    '#maxlength' => 255,
    '#weight' => -1,
    '#description' => t('To post comments please log in using OpenID.'),
  );
  $form['openid.return_to'] = array(
    '#type' => 'hidden',
    '#value' => url('openid/authenticate', array('absolute' => TRUE, 'query' => drupal_get_destination())),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Log in'),
  );
  return $form;
}

global $user;
if (! $user->uid) {
  drupal_add_css(drupal_get_path('module', 'openid') .'/openid.css', 'module');
  drupal_add_js(drupal_get_path('module', 'openid') .'/openid.js');
  print drupal_get_form('openid_login_block');
}
?>

Insight is welcomed.

yngens’s picture

subscribe

Leeteq’s picture

This should indeed be a configurable option.

I just marked the following issue as a duplicate:
http://drupal.org/node/309062

dpi’s picture

+1

dkollar’s picture

+1

francewhoa’s picture

+1

jday’s picture

I've added this to my theme's style sheet to show both log in options on the log in page

#edit-openid-identifier-wrapper { display:block !important; }
#edit-openid-identifier-wrapper:after {
	content: "OR use your Drupal log in below";
	margin:1em 0;
	border-top:1px dotted #D6D6D6;
	border-bottom:1px dotted #D6D6D6;
	padding:1em;
	display:block;
	width:350px;
}
html.js #user-login li.openid-link  { display:none; }