It's not that hard at all, it requires you to use the user hook (look it up drupal.org as I need to go to bed)... When a new user is created you simply insert the rid into the user_role table using the uid of the created user. There may be an easier way to do it, and if there is I am sure someone will chime in any moment now.
Not sure if you thought about this or not, but anyways: The authenticated user is always an assigned role by default, so you can tweek the permissions of that role to your liking, and it will be applied automatically.
We need to have the ability for a person to choose a designated group upon registration (such as "volunteer"), and be automatically assigned to that role. Does anyone have any ideas on how best to accomplish this?
logintoboggan allows you to put unverified people into a particular role, for cases where you allow your users to interact with your site before making sure they've provided a valid email address.
I also need this feature, as I made DokuWiki use the User Data from Drupals Database for Authentification, but DokuWiki needs a Role so it knows what rights the user has. Drupal's standard role (authentificated user) is not in the role table of the database, so that's the problem why I need to make another role and assign it to every new user.
This problem was solved in a comment on another thread: http://drupal.org/node/28379#comment-132430 I succesfully used a modified version of that snippet for a recent site.
Comments
Write A Module
It's not that hard at all, it requires you to use the user hook (look it up drupal.org as I need to go to bed)... When a new user is created you simply insert the rid into the user_role table using the uid of the created user. There may be an easier way to do it, and if there is I am sure someone will chime in any moment now.
--
Please read the handbook, search the forums, then ask...
http://drupal.etopian.net (Consulting, Development, and Hosting)
authenticated user
Not sure if you thought about this or not, but anyways: The authenticated user is always an assigned role by default, so you can tweek the permissions of that role to your liking, and it will be applied automatically.
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
in 4.6.3?
Is there a way to do this in 4.6.3? Or would a module need to be created to do this?
----
Blue Cobalt
Theurgy Foundation
http://www.theurgyfoundation.org
Blue Cobalt
http://livingparadise.org
Conscious living for a better world.
bump
bump.
We need to have the ability for a person to choose a designated group upon registration (such as "volunteer"), and be automatically assigned to that role. Does anyone have any ideas on how best to accomplish this?
---
Blue Cobalt
Theurgy Foundation
http://www.theurgyfoundation.org
Blue Cobalt
http://livingparadise.org
Conscious living for a better world.
i'm also interested in
i'm also interested in this...
Has to be done right
Any solution has to make sure that this is done right. Privileged roles (e.g. admin, moderator) should NOT be assigned automatically.
--
Drupal development and customization: 2bits.com
Personal: Baheyeldin.com
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
Assigning a different role to new users
If you look in the file "user.module" at line 898 you will see the line:
function _user_authenticated_id() {
return db_result(db_query("SELECT rid FROM {role} WHERE name = 'authenticated user'"));
}
Simply change "authenticated user" to the Role name that you would like to default at registration and save the file. Bingo.
bas Logintoboggan does
bas
Logintoboggan does everything you just asked for
see http://drupal.org/node/34309
Export Trade Leads
Smiley script
Football News
YP.BZ - Yellow Page Dot Business
does it really?
logintoboggan allows you to put unverified people into a particular role, for cases where you allow your users to interact with your site before making sure they've provided a valid email address.
I don't think it solves this particular problem.
I need this feature, too
I also need this feature, as I made DokuWiki use the User Data from Drupals Database for Authentification, but DokuWiki needs a Role so it knows what rights the user has. Drupal's standard role (authentificated user) is not in the role table of the database, so that's the problem why I need to make another role and assign it to every new user.
Regards, MG
This problem was solved in a
This problem was solved in a comment on another thread: http://drupal.org/node/28379#comment-132430 I succesfully used a modified version of that snippet for a recent site.
If you need assistance creating the module or using that snippet consider the guide to module developers or hiring someone to write it for you.
Regards,
Greg
--
Growing Venture Solutions
Drupal Implementation and Support in Denver, CO
--
Morris Animal Foundation
Rules is a great solution if
Rules is a great solution if you don't want to write your own module.
Better yet
There's a 5x and 6x module specifically for this— AutoAssignRole:
http://drupal.org/project/autoassignrole