inline_registration forces the user to register or login to post anonymous content

matt@antinomia - January 12, 2008 - 21:21
Project:Inline Registration
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

At the moment, the module doesn't allow site administrators to decide whether users are required to register/login in order to post content, it just forces its will (users must register/login). This denies the use case where one would still want to allow users to posts anonymously, but would use the module to make registration a bit easier.

Also, in order for inline_registration to work, permissions must be enabled for an anonymous user to create a given node type. This works, but this permission setting should probably be reserved for enabling the above. For example, if I want anonymous users to be able to post story nodes without register/login, this is where the permission should be set. But inline_registration relies on it being set in order to allow the user to post.

So IMHO there needs to be another mechanism which allows administrators to configure the node type on which inline_registration works, regardless of which node types anonymous users are allowed to post on. Let's take two use cases:

#1 - Story Node: anonymous users can create story nodes, inline_registration is enabled on story nodes
In this case, the inline_registration would be optional, and if the user did not input any registration data, the created node's author would be anonymous. However, the if the user did input registration data, a user would be created and s/he would own the created node.

#2 - Event Nodes: anonymous users can NOT create event nodes, inline resigration is enabled on event nodes
In this case, inline_registration would be required if the user wasn't logged in, and the created node would be assigned to the newly created user.

Case #1 is easy enough given the module's current architecture. But Case #2 is a bit tricker, because if we deny anonymous users the permission to create event nodes, the Drupal will return a 403 access denied when they visit the node/add/event page.

I've tried to override the menu item as such:

<?php
function inline_registration_menu($may_cache) {
 
$items = array();
  if (
$may_cache) {
  }
  else {
   
$items = array(
     
'path' => 'node/add/event',
     
'type' => MENU_CALLBACK,
     
'callback' => 'inline_registration_foo',
     
'access' => TRUE,
    );
  }
  return
$items;
}

function
inline_registration_foo() {
  return
'bar';
}
?>

but I'm still getting a 403. Anybody know how to override this properly?

#1

benone - September 6, 2009 - 18:32

Hi,
I can't get how the user can login ?
There is only registration possibility.

What I thought , it can give you 2 fields - email and password.
Where the email is in database user is logging in, if not he will be automatically registered.

Can I achive that using Inline Registration module ?

 
 

Drupal is a registered trademark of Dries Buytaert.