919 - 926 - 9847

New register feature in FarCry 5

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:


<ft:farcryButtonPanel>                    
                    <cfoutput><ul class="loginForgot"></cfoutput>
                        <sec:CheckPermission webskinpermission="forgotPassword" type="farUser">
                            <cfoutput>
                                <li><skin:buildLink type="farUser" view="forgotPassword">Forgot Password</skin:buildLink></li></cfoutput>
                        </sec:CheckPermission>
                        <sec:CheckPermission webskinpermission="forgotUserID" type="farUser">
                            <cfoutput>
                                <li><skin:buildLink type="farUser" view="forgotUserID">Forgot UserID</skin:buildLink></li></cfoutput>                        
                            <cfoutput>
                                <li><skin:buildLink type="farUser" view="registerNewUser">Register New User</skin:buildLink></li></cfoutput>
                        </sec:CheckPermission>
                    <cfoutput></ul></cfoutput>

                </ft:farcryButtonPanel>

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 ;).

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Sentiant's Gravatar Great work Matthew.
# Posted By Sentiant | 1/20/09 9:07 PM
Matthew Bryant's Gravatar Nice find on this "undocumented" feature ;) There is much more work to come on this area.

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*
# Posted By Matthew Bryant | 1/23/09 4:45 PM
Matthew Williams's Gravatar Hmm... I didn't think about that, however I almost always copy all of those templates to my local project anyway. However, it is so noted.
# Posted By Matthew Williams | 1/24/09 10:03 AM
Matthew Bryant's Gravatar Apologies if I wasn't clear. I wasn't suggesting that you updated the core files to make your change. Never change core files ;)

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 ;)
# Posted By Matthew Bryant | 1/24/09 1:53 PM