user sign up processes for different roles

Topics: Customizing Orchard, General, Writing modules
Jun 27, 2011 at 4:02 PM

Hello all,

We're implementing a big site using Orchard. Our domain has 3 distinct end user roles (plus cms admins) - all 3 types of user can sign up themselves but for 2 of the roles they need moderation (the admin must approve/reject user creation).

I'm looking for some tips on

  1. how we create users with different roles within orchards user framework
  2. how we allow some users to sign straight up but have others require moderation
  3. how we render different main menus depending on current user role

Any help appreciated


Jun 27, 2011 at 8:04 PM

How can you know which users need moderation and which don't, if they are not registered yet?

Jun 28, 2011 at 8:02 AM

Because they'll take different sign up routes/select a checkbox during registration. (eg. I'm a professional user/I'm a home user)

Jun 28, 2011 at 8:10 AM

ok then, I suppose the most priviledged users are the ones requiring validation then, right?

1. Take a look at the code in Orchard.Roles/Controllers/AdminController.cs

2. You'll probably need to provide your own controller and registering view.

3. I think Advanced Menu has that feature.

Jun 28, 2011 at 3:50 PM
Edited Jun 28, 2011 at 3:56 PM

Look at my module: ExtendedRegistration
It extends Contrib.Profile by showing any Parts you added to the User ContentType in the registration page.
You can use that to show additional info during the registration process.

To handle the different types of users, you could use IUserEventHandler.Created and take appropriate action.

Jul 5, 2011 at 10:22 PM
Edited Jul 6, 2011 at 8:25 AM

we're well into getting this working now however I've come across an oddity. I can be notified of ChallengeEmailSent and ConfirmEmail etc. but not when an admin Approves a user. This seems odd, is Approval of the user not just another event in that users lifetime?

bertrand - any idea if this is being added, or am I missing something - can I get notified of this event in some other way?



Jul 5, 2011 at 10:32 PM

Not that I know of but I can summon Sébastien, who wrote that as far as I ca remember.

Jul 5, 2011 at 10:35 PM

If it's needed, then it's missing. You might file a bug for that, and if I were you, create a fork and submit a patch. The chances it gets acceptes are high as a bunch of other events like this one have been included in the dev branch for users management. I would also check if it's not already the case.

Jul 6, 2011 at 2:32 PM

I had submitted a patch for that (User Approved Event) already, it was accepted.

Jul 6, 2011 at 3:45 PM

great stuff any idea when that is likely to hit us?