| 1 |
/**
|
| 2 |
* $Id$
|
| 3 |
* @package AccountTypes
|
| 4 |
* @category NeighborForge
|
| 5 |
*/
|
| 6 |
--Accounttypes Module--
|
| 7 |
|
| 8 |
This module is intended to make managing large sites with a lot of users and a lot of roles easier.
|
| 9 |
Roles can be grouped into account types which the site admin defines. Each account type can use any
|
| 10 |
combination of roles, so there can be some overlap of abilities/responsibilities if you want. The
|
| 11 |
module starts out with an account type called 'basic' which cannot be deleted. It also starts out
|
| 12 |
by having the 'authenticated user' role assigned to 'basic'. From there, you can add account types
|
| 13 |
and roles to each as you see fit. You don't have to use the 'basic' account type if you don't want
|
| 14 |
to. Simply uncheck any associated roles and it will be useless.
|
| 15 |
|
| 16 |
You may also designate which of the assignable roles should automatically be assigned to the user
|
| 17 |
when they receive the account type. This will not prevent you from removing roles from that user,
|
| 18 |
but should minimize work on your part if you find that you are always assigning the same roles to
|
| 19 |
users with the same account type.
|
| 20 |
|
| 21 |
After setting up an account type and associating roles with it, you will find that on the user edit
|
| 22 |
page, you can only assign the roles that correspond to that account type. All others are disabled
|
| 23 |
and greyed out. Those roles designated as auto-assigned will become checked as you switch from one
|
| 24 |
account type to another.
|
| 25 |
|
| 26 |
If you have assigned the permission 'administer users' to someone, they will be able to assign both
|
| 27 |
account types and roles from that type to users but will not be able to associate roles to account
|
| 28 |
types, nor add new account types.
|
| 29 |
|
| 30 |
The pages you will need to visit to see all of the functionality are:
|
| 31 |
|
| 32 |
--site admin--
|
| 33 |
admin/user/accounttypes - this is where you define account types
|
| 34 |
admin/user/accounttypes/edit - change the name of the account type or delete it
|
| 35 |
admin/user/accounttypes/default - just a callback from the main page that sets which account type is
|
| 36 |
automatically assigned to new site subscribers
|
| 37 |
admin/user/accounttypes/admin - this is where you assign roles to the account types
|
| 38 |
admin/user/accounttypes/assign_old_users - this is how to assign all pre-existing users to the default
|
| 39 |
account type at once; see below for a one-by-one method to preserve existing roles
|
| 40 |
|
| 41 |
--user admin--
|
| 42 |
admin/user/user - you can perform tasks on multiple users at a time and filter by account type
|
| 43 |
note: because I hijacked the filter function (for lack of hooks), if another module does the same, one
|
| 44 |
or the other won't work in all likelihood
|
| 45 |
admin/user/user/create - add a user(as usual) and set their account type and roles
|
| 46 |
user/X/edit - you edit a user here; looks similar to the user create page, but with fields added by
|
| 47 |
other modules; by editing a pre-existing user, the account type can be set (previously this was broken)
|
| 48 |
|
| 49 |
--other--
|
| 50 |
user/register - you won't see anything here as a user because the fields are hidden
|
| 51 |
|
| 52 |
I think that's everything. If I've forgotten something that you find, let me know.
|
| 53 |
|
| 54 |
As I'm new to Drupal and this was my first complete module, I'd be glad to know how to make it better,
|
| 55 |
particularly cleaning up any of the code to make it tighter.
|
| 56 |
|
| 57 |
Thanks. I hope you find this useful.
|