How do I password protect pages? [solved]

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am

How do I password protect pages? [solved]

Post by davids355 »

I have already installed the front end users module.

I have created some users.

I am just wondering is it possible to password protect certain pages so that only logged in users can view them??

Many thanks in advance

Dave
Last edited by davids355 on Thu Apr 10, 2008 2:16 pm, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: How do I password protect pages?

Post by RonnyK »

Use CustomContent as well.
There are good videos in the visual help to show the working combination.

Ronny
leslie894

Re: How do I password protect pages?

Post by leslie894 »

Calguy has also posted a very useful thread inTips and Tricks regarding "private" content:

http://forum.cmsmadesimple.org/index.ph ... 689.0.html
musicscore
Power Poster
Power Poster
Posts: 496
Joined: Wed Jan 25, 2006 11:53 am

Re: How do I password protect pages?

Post by musicscore »

Don't use the print button on an page the is protected by CustomContent module.
The printingpage does show the protected content (at lease on my pages).
I put the printbutton in the protected content area so only the logged-in users can use the printbutton.

Maybe you can see this as a bug and maybe the next version will solve this problem.

Musicscore
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am

Re: How do I password protect pages?

Post by davids355 »

Thanks guys, extremely helpful!!! Got it working now:)
Pierre M.

Re: How do I password protect pages?

Post by Pierre M. »

Hello,

@David : please prefix your first post with [solved]. It helps sorting out solutions and open issues.
musicscore wrote: Maybe you can see this as a bug and maybe the next version will solve this problem.
sorry to be off topic , but :
There is no protected/unprotected "print button" issue, because there is no "print button issue" : don't use {print}, the only "print button" is the browser's one. The (user behind the) browser is free to render/preview/print/convert the content it has downloaded via http. There is no need to mess the HTML content with ugly hacks that work less reliably than the browser.
(no offense to the {print} author ;)

Pierre M.
musicscore
Power Poster
Power Poster
Posts: 496
Joined: Wed Jan 25, 2006 11:53 am

Re: How do I password protect pages?

Post by musicscore »

The printbutton of the browser (mie & ff) prints te complete page, not just the content.
If you only want to print the content and not the menu, the header etc. you have to use the {print} tag.
But when you use the {print} tag, the custom content is always printed, even if you are not logged-in.

Musicscore
leslie894

Re: How do I password protect pages?

Post by leslie894 »

FEUsers and CustomContent is an add-on module as ooposed to Core functionality so we can't expect every older module to work properly with them. What we can hope for is that module authors will see the need to update these older modules so they do integrate with FEU and CC.

In the meantime, find a way to recognize the custom content on your pages and modify the print template so that it only prints the custom content when it is appropriate. If that's not possible only display the print option to logged in users.

Pierre, the {print} tag may not be the best but it does provide a necessary function. On my school site, people will want to print out information but do not want the header and navigation information that the browser's print function invariably includes.
Last edited by leslie894 on Thu Apr 10, 2008 1:20 pm, edited 1 time in total.
Pierre M.

Re: How do I password protect pages?

Post by Pierre M. »

Hello again,
musicscore wrote: The printbutton of the browser (mie & ff) prints te complete page, not just the content.
True. I hadn't tried subpage selection before print. I wish my browser could provide a right-click "print selection" option. It already has a "show source of selection" so there is hope for next version or a plugin.
musicscore wrote: If you only want to print the content and not the menu, the header etc. you have to use the {print} tag.
leslie894 wrote: On my school site, people will want to print out information but do not want the header and navigation information that the browser's print function invariably includes.
You don't have to use {print} for this. It is builtin CSS and browsers. It is the media=print stylesheet attribute. I put display:none to all navigation elements (headers, menus...) in my print stylesheets. Try it : this is why I think {print} is no more relevant.

Pierre M.
leslie894

Re: How do I password protect pages?

Post by leslie894 »

Pierre M. wrote: You don't have to use {print} for this. It is builtin CSS and browsers. It is the media=print stylesheet attribute. I put display:none to all navigation elements (headers, menus...) in my print stylesheets. Try it : this is why I think {print} is no more relevant.
Thanks Pierre. Sorting out the print template has been on my to do list but it sounds like I'd be better off learning a little more about CSS. I've been vaguely aware of the ability to have different CSS for different media but never really looked into it. Will do so now.
marties
Forum Members
Forum Members
Posts: 34
Joined: Tue Jan 11, 2005 11:22 am

Re: How do I password protect pages? [solved]

Post by marties »

An easier way to create a print css :

make a copy of your actual css,
rename it to print.css
then refer only to this css in your xhtml template
then slowly add at the bottom of this css the rules needed to make the header/menus/... disappear or change
Post Reply

Return to “CMSMS Core”