Automatically apply roles to registered user?

Topics: General
Apr 17, 2013 at 10:37 PM
Got a couple of questions:-

1) How do I extend the registration questions for each new user?

2) How do I automatically assign roles to a newly registered user based on the answers to the extended questions? I found this link, but wasn't sure if it is the right way to do it.

http://www.szmyd.com.pl/blog/how-to-assign-default-role-s-to-new-user-in-orchard#.UW7TfbWG02B

3) Can I automatically email the site administrator whenever a new user registers?

Any help appreciated.

Regards,

Paul.
Coordinator
Apr 17, 2013 at 10:39 PM
Right now you would need a custom module unless there is one on the gallery.

In next version, this scenario is handled by the Workflow module.
Apr 18, 2013 at 12:02 AM
1) Check out this module in the gallery: ExtendedRegistration I've never used it but should suit your needs fine. You will need to create a part and attach this to the User content type.

2) The link you mentioned would be the correct way to do it. You should be able to do:
context.User.As<MyUserPart>().*Value*
Then assign roles as described in the blog.

3) Check out the rules module and the Email messaging module, you should be able to create a rule to do this


But as Sebastien says, there is a new Workflow module coming out soon, which will help you achieve some of what you want. And I believe Rules is to be deprecated so you may want to avoid using that and wait for Orchard 1.7 :)
Apr 18, 2013 at 3:16 PM
Thanks for the replies.

Any idea when 1.7 will be released?

Regards,

Paul.
Coordinator
Apr 18, 2013 at 7:16 PM
1.7 will be released before June 13th (Orchard Harvest).

The workflow module is already working and used by some.