Hardcode Permissions ?? HELP PLZ
Permalink
Hello. So i activated advanced permissions so i could enable and disable views on blocks depending on who is logged in. This is working as it should, but after doing it i ran into another problem i hope some of you smart people can help me fix.
I made a group so that people not registret, (guests) can only see like 3 out of 15 blocks, which works great. But my site is not all build with areas that i can enable or disable view on, so now when i have disabled all the blocks i dont want guests to see, the Headers and other custom hard coded stuff is still visible to everyone since i cant turn those off. So i was thinking i need som kind of code added in my php to the hardcoded blocks i dont want to be showed?
Hope i make sense, if not please let me know what part is blurry.
Thanks for your time and help.
I made a group so that people not registret, (guests) can only see like 3 out of 15 blocks, which works great. But my site is not all build with areas that i can enable or disable view on, so now when i have disabled all the blocks i dont want guests to see, the Headers and other custom hard coded stuff is still visible to everyone since i cant turn those off. So i was thinking i need som kind of code added in my php to the hardcoded blocks i dont want to be showed?
Hope i make sense, if not please let me know what part is blurry.
Thanks for your time and help.
Thank you for your reply, but this add-on does the same as advanced permissions basicly. I need a line of code i can use in the backend to hardcode what can be seen and what cant.
Example:
In the code above i can hide the Gallery, cause it has a area which create a block in the front end... But the header h3 is still visible, so here i think i need a line of code to wrap it in so its only viewable by people logged in.
Any help is appreciated.
Example:
<div class="gallery"> <h3>Picture Header</h3> <?php $a = new Area('Gallery'); $a->display($c); ?> </div>
In the code above i can hide the Gallery, cause it has a area which create a block in the front end... But the header h3 is still visible, so here i think i need a line of code to wrap it in so its only viewable by people logged in.
Any help is appreciated.
Untested, but should work (and doesn't need adv. perms):
Just replace your example code above.
<div class="gallery"> <?php $u = new User(); if ($u->isRegistered()) { // or $u->isLoggedIn() ?> <h3>Picture Header</h3> <?php $a = new Area('Gallery'); $a->display($c); } ?> </div>
Just replace your example code above.
$u = new User(); If($u->isLoggedIn()) { }
Sent from my phone
On Jun 28, 2012 1:39 AM, "concrete5 Community" <discussions@concretecms.com>
wrote:
If i paste this code, i just get an error...
How exactly would you use this code? cause to me it seems its just alone if i paste it in like this.
How exactly would you use this code? cause to me it seems its just alone if i paste it in like this.
<?php $u = new User(); if ($u->isRegistered()) { ?> <h3>Picture Header</h3> (this is the part i want only visible to the people logged in)
<?php $u = new User(); if($u->isLoggedIn()) { ?> <h3>Picture Header</h3> <?php } ?>
This worked perfect! Thank you both
Mike