OpenID as default state for Login block

kmv - August 12, 2007 - 01:11
Project:OpenID
Version:5.x-1.x-dev
Component:OpenID Client
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

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.

#1

blakehall - August 14, 2007 - 16:07

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?

#2

kmv - August 14, 2007 - 17:54

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)

#3

dag- - February 16, 2008 - 02:45

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.

#4

yngens - April 13, 2008 - 08:59

subscribe

#5

DanielTheViking - February 27, 2009 - 09:57

This should indeed be a configurable option.

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

#6

danph - June 23, 2009 - 10:19

+1

#7

dkollar - October 30, 2009 - 11:40

+1

 
 

Drupal is a registered trademark of Dries Buytaert.