FEU Issue: Not protecting the page content.

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
cflbot
Forum Members
Forum Members
Posts: 10
Joined: Sat Aug 25, 2007 1:15 pm

FEU Issue: Not protecting the page content.

Post by cflbot »

CMS Version: 1.5.2
FrontEndUsers: 1.6.2
CustomContent: 1.5.2

All I want to do is password protect the content of a page.
I insert this into the Page Content:
{cms_module module=FrontEndUsers}
Job Application
W4 Form

It shows on the page, the log in prompt and captcha, but it also show the links Job Application and W4 Form. That is the intended hidden content.

I have tried all the different code examples and either the same result or it is one big error message.

I can log in and the page appears the way it should.

Basically it is not protecting anything.
What am I missing, I want a page that does not show until the user logs in.
Coldman
Power Poster
Power Poster
Posts: 318
Joined: Sun Jun 22, 2008 5:33 am

Re: FEU Issue: Not protecting the page content.

Post by Coldman »

Have insert something like this..

{if $ccuser->loggedin() && $ccuser->memberof('members') && $ccuser->ipmatches('192.168.0.0/24')}
Welcome logged in local member
{elseif $ccuser->loggedin() && $ccuser->memberof('members')}
Welcome logged in member
{elseif $ccuser->loggedin()}
Welcome user from some other group
{else}
Anonymous user
{/if}
Important Code of Conduct
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
cflbot
Forum Members
Forum Members
Posts: 10
Joined: Sat Aug 25, 2007 1:15 pm

Re: FEU Issue: Not protecting the page content.

Post by cflbot »

Thanks for response.

Put this in Theme Template:
{if $ccuser->loggedin() && $ccuser->memberof('Managers') && $ccuser->ipmatches('192.168.0.0/24')}
Welcome logged in local member
{elseif $ccuser->loggedin() && $ccuser->memberof('Managers')}
Welcome logged in member
{elseif $ccuser->loggedin()}
Welcome user from some other group
{else}
Anonymous user
{/if}

Put this in Page Content:
Job Application (link to a document)
W4 Form (link to a document

This is Produced on Page:
Welcome logged in member

While I was waiting for a reply, I tried this in the Theme Template:

{if $customcontent_loggedin > 0} Hello {$customcontent_loginname}   

{content}

  {else}Managers Only...

{cms_module module=FrontEndUsers}{/if}

Got the right result, except did not have a log out option or change settings.

Tried This:
{if $ccuser->loggedin() && $ccuser->memberof('Managers') && $ccuser->ipmatches('192.168.0.0/24')}
Welcome logged in local member
{elseif $ccuser->loggedin() && $ccuser->memberof('Managers')}
Welcome logged in member
{elseif $ccuser->loggedin()}
Welcome user from some other group
{else}
Anonymous user
{/if}
{cms_module module=FrontEndUsers}
Now I have Sign Out and Change Settings, but nothing happens when I click those buttons.
Last edited by cflbot on Sat Jan 31, 2009 8:30 pm, edited 1 time in total.
Coldman
Power Poster
Power Poster
Posts: 318
Joined: Sun Jun 22, 2008 5:33 am

Re: FEU Issue: Not protecting the page content.

Post by Coldman »

Think this will work..

Code: Select all

{if $ccuser->loggedin() && $ccuser->memberof('Managers')}
Welcome logged in local member
{cms_module module=FrontEndUsers}
{content}
{else}
Anonymous user
{cms_module module=FrontEndUsers}
{content}
{/if}
Last edited by Coldman on Sat Jan 31, 2009 9:30 pm, edited 1 time in total.
Important Code of Conduct
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
cflbot
Forum Members
Forum Members
Posts: 10
Joined: Sat Aug 25, 2007 1:15 pm

Re: FEU Issue: Not protecting the page content.

Post by cflbot »

Thanks for continued help.
Put this in the theme template:
{if $ccuser->loggedin() && $ccuser->memberof('Managers')}
Welcome logged in local member
{cms_module module=FrontEndUsers}
{content block="secure"}
{else}
Anonymous user
{cms_module module=FrontEndUsers}
{content}
{/if}

Shows the content on the page before you log in.

Check it Out:
http://www.cflbot.com/valvoline/index.php?page=forms

Also When You Log In:
Welcome logged in local member
Welcome John

Sign out (Does Not Work)

Change My Settings (Does Not Work)

I don't think I understand:
{content block="secure"}
Last edited by cflbot on Sat Jan 31, 2009 9:36 pm, edited 1 time in total.
Coldman
Power Poster
Power Poster
Posts: 318
Joined: Sun Jun 22, 2008 5:33 am

Re: FEU Issue: Not protecting the page content.

Post by Coldman »

Put this in your template

Code: Select all

{if $ccuser->loggedin() && $ccuser->memberof('Managers')}
  {content block="secure"}
{else}
  {content}
{/if}
Read more about content blocks here http://wiki.cmsmadesimple.org/index.php/FAQ2

In your content for page "Form" add for ex.
You do not have permission to be here!
{cms_module module=FrontEndUsers}

And in your content block secure
Hi user
{cms_module module=FrontEndUsers}

EDIT:
And one more thing ... your page must have cache unchecked
Last edited by Coldman on Sat Jan 31, 2009 10:18 pm, edited 1 time in total.
Important Code of Conduct
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
cflbot
Forum Members
Forum Members
Posts: 10
Joined: Sat Aug 25, 2007 1:15 pm

Re: FEU Issue: Not protecting the page content.

Post by cflbot »

Thank You for your Help.
I resolved with your influence.
Coldman is the first to ever answer my cries for help. :D

My last question should have been do you know the proper context to use the following command:
{cms_module module=FrontEndUsers} with
Parameters
(optional) form="name"
Forms:
login - Display the login form
logout - Display the logout form
The manual does not give an example like, "{cms_module module=FrontEndUsers form=logout}"
I know I should have guessed it. ??? ???

I have done the following to create a page that requires a login to see the content: 8)
Created a Template called "Secure" with this code:
{if $customcontent_loggedin}
    {if $customcontent_memberof_Managers}
Hello {$customcontent_loginname}   
{content}
{/if}
  {else}Managers Only...
Please login
{cms_module module=FrontEndUsers}{/if}

Then Created a Page with content that I wanted secure with this code:
Job Application (link to a form)
W4 Form (link to a form)
{cms_module module=FrontEndUsers form=logout}

Warning: This does not keep a direct path to the file from being used to see the file, I locked the directory the forms are in from the server level. ;)

I am sorry but know other manual examples worked they either showed the secure content without logging in or showed no content what so ever. ???

Just having this example"{cms_module module=FrontEndUsers form=logout}" in help would have saved me hours of messing around. ::)

I can't wait till you can click a box in the page propeties that says secure page... ::)
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: FEU Issue: Not protecting the page content.

Post by jmcgin51 »

cflbot wrote: Warning: This does not keep a direct path to the file from being used to see the file, I locked the directory the forms are in from the server level. ;)
Use the Uploads module to protect uploaded files from being viewed by unauthorized users.
cflbot wrote: Just having this example"{cms_module module=FrontEndUsers form=logout}" in help would have saved me hours of messing around. ::)
It's right there in the Help:
Parameters

    * (optional) form="name"

      Forms:
          o login - Display the login form
          o logout - Display the logout form
          o changesettings - Display the change settings form
          o forgotpw - Display the forgot password form
          o lostusername - Display the lost username form.
          o silent = Display nothing, but export properties and other smarty variables for the currently logged in user. If no user is logged in, then no variables are exported.
cflbot wrote: I can't wait till you can click a box in the page propeties that says secure page... ::)
Yes, would be convenient, but the current implementation is much more flexible.  If you just have a checkbox, you have no way to specify which groups/users should be allowed to view the page, or set any other parameters.
Last edited by jmcgin51 on Sun Feb 01, 2009 4:33 am, edited 1 time in total.
Post Reply

Return to “Modules/Add-Ons”