Setup Guide for FrontEndUsers and CustomContent Modules
Setup Guide for FrontEndUsers and CustomContent Modules
Hi All
Been using CMS for some time now and I have a requirement to have password protected content. I have installed the correct modules to do this I think (FrontEndUsers and CustomContent) but I cant seem to get what I want to achive.
What I need is to have a some pages which are only available to certain users. The users will be able to register for an account where I can then assign them to a group. Then I want to be able to pick some pages to which are protected.
Can anyone provide me with a step by step guide on how to achieve this?? as I think I am going mad!!
Thanks in advanced
Adam
Been using CMS for some time now and I have a requirement to have password protected content. I have installed the correct modules to do this I think (FrontEndUsers and CustomContent) but I cant seem to get what I want to achive.
What I need is to have a some pages which are only available to certain users. The users will be able to register for an account where I can then assign them to a group. Then I want to be able to pick some pages to which are protected.
Can anyone provide me with a step by step guide on how to achieve this?? as I think I am going mad!!
Thanks in advanced
Adam
Re: Setup Guide for FrontEndUsers and CustomContent Modules
If you want users to be able to register for an account, you will also need module "SelfRegistration"
Typically what you want to do is have users register via the SelfRegistration module, and put them in a group. If you want to approve users before giving them access, put them in a "temp" group that can't access anything except a "your account is under review" page. If you want them to have access immediately, put them straight into your target group, we'll call it "Members".
Once you have some people in your Members group, you need to let them log in. You'll need to set up a login page, which is available to everyone. I like to make a custom template for this page. Here is an example of the important part of the template:
Note that "{global_content name='MemberMenu'}" is not a requirement, it's just a global content block that I put a menu in.
Create a page using this template, and within the the page, you'd put your Front End User tag, like so:
The end result to the user is they come, and are shown the output of {cms_module module=FrontEndUsers} ... a login form, if they are not already logged in. Once they log in, they have permission to see the Members-only content in the template, the additional "Login Successful" message, and the global content block with the members menu.
Now all you need is some content pages. Make a custom template for Member pages, with something similar to the following:
For any page you want to be protected, you'd use this template. This template prevents anyone not logged in as "Members" group from seeing the content.
EDIT: Be sure to uncheck the "cacheable" option on your protected pages (on the options tab in page editor).
The other thing to consider is menuing inside the members area. I believe there is a plugin for use with FrontEndUsers that makes the menu system aware of FrontEndUser permissions, but I have not tested it. (and I can't recall its name at the moment). So far I've had relatively minor content in member areas, and have just built my own menu in a global content block.
That's pretty much it, hope this helps.
--Vaughn
Typically what you want to do is have users register via the SelfRegistration module, and put them in a group. If you want to approve users before giving them access, put them in a "temp" group that can't access anything except a "your account is under review" page. If you want them to have access immediately, put them straight into your target group, we'll call it "Members".
Once you have some people in your Members group, you need to let them log in. You'll need to set up a login page, which is available to everyone. I like to make a custom template for this page. Here is an example of the important part of the template:
Code: Select all
{if $ccuser->loggedin() && $ccuser->memberof('Members')}
<center><h3>Member Login Successful</h3>
{global_content name='MemberMenu'}
{else}
<h3>Login Required</h3>
{/if}
{content}
Create a page using this template, and within the the page, you'd put your Front End User tag, like so:
Code: Select all
{cms_module module=FrontEndUsers}
The end result to the user is they come, and are shown the output of {cms_module module=FrontEndUsers} ... a login form, if they are not already logged in. Once they log in, they have permission to see the Members-only content in the template, the additional "Login Successful" message, and the global content block with the members menu.
Now all you need is some content pages. Make a custom template for Member pages, with something similar to the following:
Code: Select all
{if $ccuser->loggedin() && $ccuser->memberof('Members')}
{global_content name='MemberMenu'}
{content}
{else}
<font color="red"><H3>Access Forbidden</H1>
You must be logged in to view this page. </font>
{/if}
EDIT: Be sure to uncheck the "cacheable" option on your protected pages (on the options tab in page editor).
The other thing to consider is menuing inside the members area. I believe there is a plugin for use with FrontEndUsers that makes the menu system aware of FrontEndUser permissions, but I have not tested it. (and I can't recall its name at the moment). So far I've had relatively minor content in member areas, and have just built my own menu in a global content block.
That's pretty much it, hope this helps.
--Vaughn
Last edited by vaughnt on Mon Aug 04, 2008 1:18 pm, edited 1 time in total.
Re: Setup Guide for FrontEndUsers and CustomContent Modules
But if someone knows the url of the custom content then they can type it in and get the page w/o being logged in...
Re: Setup Guide for FrontEndUsers and CustomContent Modules
If that is the case, I'm all ears.mark wrote: But if someone knows the url of the custom content then they can type it in and get the page w/o being logged in...
Here is an example page, protected as I have outlined above.
http://www.horizonforest.com/index.php? ... loyee-home
How do you get to the custom content?
Re: Setup Guide for FrontEndUsers and CustomContent Modules
Ok so you have the content in the login...
Re: Setup Guide for FrontEndUsers and CustomContent Modules
Phew... you had me scared there for a sec. 

Re: Setup Guide for FrontEndUsers and CustomContent Modules
Thanks Vaughnt... This looks easy enough I will give it a try on Monday!!
Cheers
Adam
Cheers
Adam
Re: Setup Guide for FrontEndUsers and CustomContent Modules
I have tried this too, but I get errors.
When I try to access the protected page and also after login I get:
Parse error: syntax error, unexpected T_ELSE in /home/libralion/domains/jomedio.nl/public_html/cmsmadesimple/tmp/templates_c/91^%%70^707^707A8977%%content%3Acontent_en.php on line 3
This what I have on the protected page:
Is that ok?
This is my testsite: http://www.jomedio.nl/cmsmadesimple/
When I try to access the protected page and also after login I get:
Parse error: syntax error, unexpected T_ELSE in /home/libralion/domains/jomedio.nl/public_html/cmsmadesimple/tmp/templates_c/91^%%70^707^707A8977%%content%3Acontent_en.php on line 3
This what I have on the protected page:
Code: Select all
if $ccuser->loggedin()} Welkom lid {else}
U bent niet bevoegd om deze pagina te zien.
{/if}
This is my testsite: http://www.jomedio.nl/cmsmadesimple/
Last edited by libralion on Sun Aug 03, 2008 4:34 pm, edited 1 time in total.
Re: Setup Guide for FrontEndUsers and CustomContent Modules
You're missing a bracket, try this:
Code: Select all
{if $ccuser->loggedin()}
Welkom lid
{else}
U bent niet bevoegd om deze pagina te zien.
{/if}
Last edited by sn3p on Sun Aug 03, 2008 4:44 pm, edited 1 time in total.
Re: Setup Guide for FrontEndUsers and CustomContent Modules
Thanks. I added this:sn3p wrote: You're missing a bracket, try this:
Code: Select all
{if $ccuser->loggedin()} Welkom lid {else} U bent niet bevoegd om deze pagina te zien. {/if}
Code: Select all
{if $customcontent_loggedin} Welkom {$customcontent_loginname}
Dit is de beveiligde pagina met alle gegevens.
{else} U bent niet bevoegd om deze gegevens te bekijken{/if}
Now it works.
Re: Setup Guide for FrontEndUsers and CustomContent Modules
Ah, I forgot to put that in. I'll modify the post.libralion wrote: And what I forgot is that the protected page can't have the cache option!
Now it works.
Re: Setup Guide for FrontEndUsers and CustomContent Modules
I get this error and I have tried everything on this post.

Code: Select all
string(131) "Smarty error: [in content:content_en line 1]: syntax error: unidentified token ';loggedin()' (Smarty_Compiler.class.php, line 1407)"
Parse error: syntax error, unexpected '&' in /homepages/2/d201892685/htdocs/LPPSR/tmp/templates_c/44^%%70^707^707A8977%%content%3Acontent_en.php on line 3
Re: Setup Guide for FrontEndUsers and CustomContent Modules
What does your tag look like, it helps if you post all relevant info, like how you wrote the thing in where like template or in content edit box etc...
Re: Setup Guide for FrontEndUsers and CustomContent Modules
Guys is there any easier way. I am getting errors and i know i am doing something wrong.
Re: Setup Guide for FrontEndUsers and CustomContent Modules
You need to be way more specific and provide a lot more information if you want help. Just saying "I am getting errors" is like saying "I have a problem with my car". Anyone trying to help you doesn't even know where to start...