Can't access current user access level

By goodonyx - August 5, 2013

The following code was working to determine a user's access level when they logged into my website.

@$CURRENT_USER['accessList']['all']['accessLevel']

I've recently upgraded to CMS Builder v2.53 and Membership plugin v1.10 and the code above is not returning any access level for the admin. I'm not sure if something changed or I need to access this property in a different way.

thanks,

Tim

By gregThomas - August 7, 2013

Hi Tim,

This feature was removed in the recent release of CMS Builder. You can easily get this information again by adding this line were you need to check a users access level:

$CURRENT_USER['accessList'] = array_groupBy(mysql_select("_accessList", "userNum = '".$CURRENT_USER['num']."'"), 'tableName'); 

So this line will add the accessList array to the users $CURRENT_USER variable. 

Let me know if you have any questions.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com