creating first login funcionality

Topics: Customizing Orchard
Mar 17, 2011 at 8:19 PM

I'm looking for ideas.  I want to modify Orchard so that newly registered users are redirected to a specific page on first login.  The idea is to make users fill basic profile information (or whatever) after registration. Its a pretty common scenario.

I started to modify the Orchard.User module by adding a 'isFirstLogin' property to the UserPart.  Seemed like it would be a small, manageable change until I ran in the 'CreateUserParams' which is used in various parts of the code and breaks the idea of changing the UserPart.   At that point I stopped because I want to keep any changes fairly isolated so I don't have a lot of merging on future releases.

So I'm thinking of assigning a temp role to newly created users.  That role will be detected on login and used to redirect.   Once the user finishes some registration process, the role will be changed again to allow them access to non-public areas.   The idea should work but again, it will require a number of changes to the User module as well as some role lookup logic added to the Roles module.

Can anyone think of less intrusive manner to achieve the same result?

Mar 17, 2011 at 8:50 PM
Edited Mar 17, 2011 at 8:51 PM

How I understand it is that, you should fully take advantage of MVC by creating a controller for the user area you want the registered/logged in user to be directed to. From there whatever that user does or goes can remain on that conroller, which is essentially different and separate from, say, the Admin controller or any other roles you may need. Learning/knowing ASP.NET MVC will certainly benefit anyone, not only to work with Orchard but in general because it is more optimized than anything else out there.