• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: FEU: protected part of a page
PostPosted: Tue May 19, 2020 6:22 pm 
Offline
Forum Members
Forum Members

Joined: Fri Oct 19, 2012 8:58 pm
Posts: 105
To see a website you have to be logged in. But there is a small part on the website which is only for one individual. This can be done with
\$1:
{feu_protect groups="Group_1"}
and for another part
\$1:
{feu_protect groups="Group_2"}
. This means I have to put every person that can log in in a unique group. It would be great if this protect could be accomplished with userid (lidnummer). I tried
\$1:
userid="123"
, but that didn't do the trick. If it's not possible, than I'll a lot of unique groups, which is a hack.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: FEU: protected part of a page
PostPosted: Thu May 21, 2020 8:26 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Fri Apr 18, 2008 9:34 pm
Posts: 364
Location: Nimbin, Australia
i'm not sure i understand exactly what you are trying to do, but you can get the current userid
\$1:
{$currentUserId=feu_smarty::get_current_userid()}
Then place your content inside
\$1:
{if $currentUserId == 123}blah{/if}
Untested.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: FEU: protected part of a page
PostPosted: Thu May 21, 2020 8:35 pm 
Offline
Dev Team Member
Dev Team Member

Joined: Mon Nov 28, 2011 9:29 am
Posts: 3210
Location: The Netherlands
And please note, for security reasons, if you're putting that logic in your page TEMPLATE, then do NOT use the default content block {content} to store the secret content.

You should use a different one. E.g. {content block=secret_content ... }

The reason for this that the content of the default content block can always be retrieved, no matter what logic is used in the page template.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: FEU: protected part of a page
PostPosted: Mon May 25, 2020 10:24 am 
Offline
Forum Members
Forum Members

Joined: Fri Oct 19, 2012 8:58 pm
Posts: 105
Thanks rotezecke. I tested your answer, but it's not the answer unfortunately. Basicly I want (a part of) a page only open for one person with an unique id. Now I only can accomplish this by giving every person an unique group-number. Using only the id would be better.

Velden, I know about the risks. But it's not for the default content-block. Thanks for warning me.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: FEU: protected part of a page
PostPosted: Mon May 25, 2020 3:41 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 958
Location: Victoria, BC
What doesn't work about the method rotezecke posted? I've used similar in the past to customize content for specific users with no issue.

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: FEU: protected part of a page
PostPosted: Mon May 25, 2020 6:37 pm 
Offline
Forum Members
Forum Members

Joined: Fri Oct 19, 2012 8:58 pm
Posts: 105
DIGI3, if I use the code rotezecke suggested, nothing shows on the page. If I use
\$1:
{feu_protect groups="Student_1"}some content {/feu_protect}
some content is only shown to the person in the group Student_1.
I hope it's clear what I mean.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: FEU: protected part of a page
PostPosted: Mon May 25, 2020 7:17 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 958
Location: Victoria, BC
I would try to diagnose why it's not working then - it should.

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: googlebot, Simon66


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Hosting Nation - Managed CMSMS Hosting