Making use of CMSB session to restrict access to certain pages

3 posts by 2 authors in: Forums > CMS Builder
Last Post: October 19, 2010   (RSS)

Re: [8bit Gamer] Making use of CMSB session to restrict access to certain pages

By Jason - October 19, 2010

Hi Paul,

When you login to CMSB, a variable called $CURRENT_USER is created. This is an array that holds all of the information for that user that is stored in the accounts table. This means that if you add a field to this table (ie dealer_title) you'll be able to access it from the $CURRENT_USER variable.
NOTE: if you're not using the website membership plugin, you can only access this variable IF they logged in through CMS Builder.

You can access these fields like this:
<?php
echo $CURRENT_USER['username'];
echo $CURRENT_USER['dealer_title'];
?>


Hope this helps. Let me know if you run into any issues.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Making use of CMSB session to restrict access to certain pages

That seems perfect Jason!

Also I want them to login in through CMS builder.

CMSB never fails to amaze me, that and the staff !

Paul