Setup Guide for FrontEndUsers and CustomContent Modules

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
acweb

Setup Guide for FrontEndUsers and CustomContent Modules

Post by acweb »

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
vaughnt
Forum Members
Forum Members
Posts: 82
Joined: Tue Jun 13, 2006 2:05 pm

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by vaughnt »

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:

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}
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:

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}
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
Last edited by vaughnt on Mon Aug 04, 2008 1:18 pm, edited 1 time in total.
--
My photography: http://vaughnsphotoart.com
Festiva Resorts: http://www.festiva.travel
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by Dr.CSS »

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...
vaughnt
Forum Members
Forum Members
Posts: 82
Joined: Tue Jun 13, 2006 2:05 pm

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by vaughnt »

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...
If that is the case, I'm all ears.

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?
--
My photography: http://vaughnsphotoart.com
Festiva Resorts: http://www.festiva.travel
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by Dr.CSS »

Ok so you have the content in the login...
vaughnt
Forum Members
Forum Members
Posts: 82
Joined: Tue Jun 13, 2006 2:05 pm

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by vaughnt »

Phew... you had me scared there for a sec.  :)
--
My photography: http://vaughnsphotoart.com
Festiva Resorts: http://www.festiva.travel
acweb

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by acweb »

Thanks Vaughnt... This looks easy enough I will give it a try on Monday!!

Cheers

Adam
libralion
Forum Members
Forum Members
Posts: 191
Joined: Fri Jul 11, 2008 4:11 pm
Location: The Netherlands

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by libralion »

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:

Code: Select all

if $ccuser->loggedin()} Welkom lid {else}

U bent niet bevoegd om deze pagina te zien.

{/if}
Is that ok?
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.
sn3p
Forum Members
Forum Members
Posts: 169
Joined: Mon Oct 15, 2007 2:27 pm

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by sn3p »

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.
libralion
Forum Members
Forum Members
Posts: 191
Joined: Fri Jul 11, 2008 4:11 pm
Location: The Netherlands

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by libralion »

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}
Thanks. I added this:

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}
And what I forgot is that the protected page can't have the cache option!
Now it works.
vaughnt
Forum Members
Forum Members
Posts: 82
Joined: Tue Jun 13, 2006 2:05 pm

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by vaughnt »

libralion wrote: And what I forgot is that the protected page can't have the cache option!
Now it works.
Ah, I forgot to put that in. I'll modify the post.
--
My photography: http://vaughnsphotoart.com
Festiva Resorts: http://www.festiva.travel
musashi39
New Member
New Member
Posts: 7
Joined: Fri Jul 11, 2008 7:54 am

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by musashi39 »

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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by Dr.CSS »

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...
nextgen
Forum Members
Forum Members
Posts: 21
Joined: Fri May 07, 2010 11:09 am

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by nextgen »

Guys is there any easier way. I am getting errors and i know i am doing something wrong.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Setup Guide for FrontEndUsers and CustomContent Modules

Post by jmcgin51 »

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...
Locked

Return to “Modules/Add-Ons”