[FEU] check if user is allowed to view this page

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
mcDavid
Power Poster
Power Poster
Posts: 377
Joined: Tue Mar 31, 2009 8:45 pm
Location: Delft, Netherlands

[FEU] check if user is allowed to view this page

Post by mcDavid »

I'm trying to set up my website with the new Protected Content content-type to protect some pages. Only problem is: some protected pages have a different template than the login form. So the {content} area is not big enough to hold the login form.
So I'm trying to make my template check if the content is protected and the user is allowed to view it.
I tried using {if $ccuser->loggedin()}, but this only partially works because if the user is logged in but is not allowed to view this page, he still gets to see te login form in the {content} area.
So I tried to find a smarty variable that tells me if the user is allowed to view the content, and I found it:
{$content_obj->feu_protected_page->_contentBlocksLoaded:protected}
But, this doesn't work, because the ":protected" part.

Does anybody know an easy way to check this? Maybe with a user defined tag?
cleatus
Forum Members
Forum Members
Posts: 27
Joined: Mon Jul 18, 2011 4:36 pm

Re: [FEU] check if user is allowed to view this page

Post by cleatus »

well, this may not be what you're after but you could set feu to redirect to separate page in FEU> preferences>protected page settings instead of "show login form". right now it sounds like it's trying to show contact form inside your other pages as you described.
mcDavid
Power Poster
Power Poster
Posts: 377
Joined: Tue Mar 31, 2009 8:45 pm
Location: Delft, Netherlands

Re: [FEU] check if user is allowed to view this page

Post by mcDavid »

that's not an option, because you don't get redirected back to the page you are looking for after logging in.
cleatus
Forum Members
Forum Members
Posts: 27
Joined: Mon Jul 18, 2011 4:36 pm

Re: [FEU] check if user is allowed to view this page

Post by cleatus »

maybe if you used custom content to protect page instead of FEU protected content then the custom content method would work fully?
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: [FEU] check if user is allowed to view this page

Post by jmcgin51 »

mcDavid wrote:that's not an option, because you don't get redirected back to the page you are looking for after logging in.
you can with a little Smarty magic
mcDavid
Power Poster
Power Poster
Posts: 377
Joined: Tue Mar 31, 2009 8:45 pm
Location: Delft, Netherlands

Re: [FEU] check if user is allowed to view this page

Post by mcDavid »

cleatus wrote:maybe if you used custom content to protect page instead of FEU protected content then the custom content method would work fully?
That's how it's working now, it works fine but it means I have a lot of templates, one for each possible combination of rights... And that's exactly what I'm trying to get rid off ;)
jmcgin51 wrote:
mcDavid wrote:that's not an option, because you don't get redirected back to the page you are looking for after logging in.
you can with a little Smarty magic
How would I do that? I'd somehow have to send a return-id along with the redirect?
It would be a solution but I still think a login without redirect would be nicer.
cleatus
Forum Members
Forum Members
Posts: 27
Joined: Mon Jul 18, 2011 4:36 pm

Re: [FEU] check if user is allowed to view this page

Post by cleatus »

i'm not currently using this functionality but maybe the last post on this thread works?
http://forum.cmsmadesimple.org/viewtopic.php?t=44492
Post Reply

Return to “Modules/Add-Ons”