Page 1 of 1
FEU Issue: Not protecting the page content.
Posted: Sat Jan 31, 2009 6:42 pm
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.
Re: FEU Issue: Not protecting the page content.
Posted: Sat Jan 31, 2009 7:23 pm
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}
Re: FEU Issue: Not protecting the page content.
Posted: Sat Jan 31, 2009 7:55 pm
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.
Re: FEU Issue: Not protecting the page content.
Posted: Sat Jan 31, 2009 8:59 pm
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}
Re: FEU Issue: Not protecting the page content.
Posted: Sat Jan 31, 2009 9:30 pm
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"}
Re: FEU Issue: Not protecting the page content.
Posted: Sat Jan 31, 2009 10:01 pm
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
Re: FEU Issue: Not protecting the page content.
Posted: Sat Jan 31, 2009 11:38 pm
by cflbot
Thank You for your Help.
I resolved with your influence.
Coldman is the first to ever answer my cries for help.
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:
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... 
Re: FEU Issue: Not protecting the page content.
Posted: Sun Feb 01, 2009 4:31 am
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.