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?
[FEU] check if user is allowed to view this page
Re: [FEU] check if user is allowed to view this page
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.
Re: [FEU] check if user is allowed to view this page
that's not an option, because you don't get redirected back to the page you are looking for after logging in.
Re: [FEU] check if user is allowed to view this page
maybe if you used custom content to protect page instead of FEU protected content then the custom content method would work fully?
Re: [FEU] check if user is allowed to view this page
you can with a little Smarty magicmcDavid wrote:that's not an option, because you don't get redirected back to the page you are looking for after logging in.
Re: [FEU] check if user is allowed to view this page
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 offcleatus wrote:maybe if you used custom content to protect page instead of FEU protected content then the custom content method would work fully?
How would I do that? I'd somehow have to send a return-id along with the redirect?jmcgin51 wrote:you can with a little Smarty magicmcDavid wrote:that's not an option, because you don't get redirected back to the page you are looking for after logging in.
It would be a solution but I still think a login without redirect would be nicer.
Re: [FEU] check if user is allowed to view this page
i'm not currently using this functionality but maybe the last post on this thread works?
http://forum.cmsmadesimple.org/viewtopic.php?t=44492
http://forum.cmsmadesimple.org/viewtopic.php?t=44492