Allow batch assignment of users to domains

agentrickard - June 13, 2009 - 18:35
Project:Domain Access
Version:6.x-2.0-rc7
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:patch (to be ported)
Description

This is a spin-off from #487842: Errror message when trying to create new content -- warning: Invalid argument supplied for foreach()....

We need a mechanism to batch assign users to and from domains.

#1

agentrickard - June 13, 2009 - 18:39

Question #1 is this:

When enabling the module, should we batch assign all users to the default domain?

There is a behavior inconsistency, in that users registered _after_ installation are auto-assigned to a domain, so should we not do so for old accounts on module enable?

[Note that we did not do this in D5 because the data was serialized onto the $user object, which would be difficult to do in hook_enable().]

#2

agentrickard - June 13, 2009 - 18:43
Status:active» needs review

Here is a patch to auto-add users to the primary domain. Note that we deliberately exclude user 0, to avoid accidental security issues if the anon role is given the 'edit domain nodes' permission.

AttachmentSize
490846-user-enable.patch 1.68 KB

#3

agentrickard - June 14, 2009 - 19:12

Patch, part two.

I will clean up the first one and then post a merged patch.

AttachmentSize
490846-admin.patch 6.11 KB

#4

agentrickard - June 14, 2009 - 19:26
Status:needs review» patch (to be ported)

Here is the final patch.

Committed to HEAD.

AttachmentSize
490846-user-management.patch 11.17 KB
 
 

Drupal is a registered trademark of Dries Buytaert.