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
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
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.
#3
Patch, part two.
I will clean up the first one and then post a merged patch.
#4
Here is the final patch.
Committed to HEAD.