Archive for July, 2014

Having your cake and eating it – UserCake

Monday, July 21st, 2014

Setting up Usercake

The setting up of UserCake is pretty straight forward, and is very straight forward and is listed below:
http://usercake.com/docs.php#5

However the configueration docs can be a little less than clear.

So how do you protect your pages

There are three basic functions which are used to protect pages in UserCake


It is the function which ought to be used if you want the admin panel to dynamically control which permission levels have access to a page.

 

This function checks if a user has been granted a Permission Level. It’s useful if you have content on a page (such as admin features) which you only want specific users to see. You simply specify the Permission Levels who ought to have access as an array.

 

This function checks if the user is logged in. It’s useful if your permission levels change often, and you have a page you want everyone to have access to, or for public pages where you want some parts only to be visible to logged in users (such as the box to post comments on a blog).

The isUserLoggedIn(); function is probalbly the most used of these functions, where it allows people to see the content that only a logged in user will see, this means that if you want a logged in user to access the page, then he can do so, but you can still see the page, If you put this in a nice if statment.