I've been wanting to write this up for a few weeks, and tonight appears to be the night. My most recent project has a members area that's integral to the site. Now, what's nice about FarCry is it already has a user management system.
Now, I usually create a custom login for each project, as most people want all the aspects of the site to match their look and feel. Silly, right ;). Anyway, I'm poking around in the default login template, and I came across this:
I'm thinking, "Wow, that's cool. Looks like they have a forgotten username/password templates there, that's new". But then I hit that last one, the registerNewUser template. And my mind found a happy place... a really really happy place. I know that the register user one wasn't there in the 4.0 builds, I wonder if it works? It turns out that it does, and it works really very well. So, here's how you enable self user registration.
By default, anonymous cannot view the templates required to create a user. There's several templates involved here, and they reside in the dmProfile/farUser webskin folders. I spent the better part of two hours trying to figure out WHY I couldn't see the bloody template. And here's why I couldn't. You need log into the webtop and enable access to the correct templates.
So, log into the webtop and browser to the "Admin" tab, and then on the left hand navigation choose the "Roles" link. When the roles load into the main content section, choose to edit the anonymous role. Now, I spent forever looking in permissions, but it's actually the Webskin link which needs to be addressed. You need to double click on the following to give Anonymous access to view them:
farUser.registerConfirmation farUser.registerConfirmationAccepted farUser.registerConfirmationEmail farUser.registerEditNewUser farUser.registerNewUser dmProfile.registerEditNewProfile
And, that's it. You can now allow users to self register. Well, Ok, that's not quite the end. You need to style the above pages to match your look and feel. You'll likely also want to flesh out the basic information sent in the confirmation email template to suite your tastes. Did I ever mention how much I like FarCry ;).
Be careful of the role that is assigned to self registration. It is set by default as "member" but you can modify that by extending the "registerNewUser.cfm" webskin in farUser. Please be careful about extending, as this is "undocumented feature" so the structure of this functionality may change.
NOTE: You can also use the permissions syntax like so:
farUser.register*
farUser.forgot*
Its just that if you copy the webskin into your project in order to extend it, and we go an change the functionality contained in that webskin (in core) or even rename the webskin or other some such crazy thing... then your webskin may be effected.
The only reason I even mention this is because its undocumented so just be extra careful ;)