Admin only information on site pages not showing when a client is logged in as an admin

6 posts by 2 authors in: Forums > CMS Builder
Last Post: October 17, 2022   (RSS)

Hi All,

I’ve set up some information on my site pages that’s accessible to admins only by using

//Get the current CMS users details
$CMS_USER = getCurrentUserFromCMS();

at the top of the page after the get records calls, and then surrounding the privileged information with

<?php if (@$CURRENT_USER && @$CURRENT_USER['isAdmin']): ?>
‘Privileged’ Information Goes Here
<?php endif ?>

I have no issues accessing the ‘privileged’ information in Chrome when logged in as an admin on another tab (even in incognito mode),

The problem is that I’ve got a client who cannot see that information when logged in as an admin (although they can access the CMSB management pages, modify records, and perform any other admin functions).

They’ve tried a number of things to resolve the issue with no success on both Edge and Chrome, including clearing cookies and cache files, and resetting any security permissions to their default status.

They "said" that they even tried to log in and then access the ‘privileged’ pages on an old iPhone and another laptop with no luck.

The only difference I’ve been able to find so far is that when I log in using Chrome, I see the same number of cookies in use (2) for both the CMSB Admin page and the page with the privileged’ information. (Under the lock icon to the left of the URL)

Their Chrome browser shows 2 cookies in use for the CMSB admin page, but no cookies in use for the page with the ‘privileged’ information.

They are not using incognito browsing as far as I can tell, but as I mentioned, when I use incognito, cookies are still read by both tabs.

Any thoughts?

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By Dave - October 14, 2022

Hi Jerry, 

It might be a variable mismatch issue.  You're setting $CMS_USER but checking $CURRENT_USER.

$CURRENT_USER might be being set somewhere else automatically in some cases.  What happens if you check $CMS_USER? 

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

Thanks Dave,

Didn't know that might make a difference, since it was working for me.

I'll check with my client and see if that works.

Have a great weekend,

Jerry

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By gkornbluth - October 14, 2022 - edited: October 14, 2022

Hi Dave,

Had my client clear cache and cookies and try the new code on both Edge and Chrome but that doesn't appear to be the solution for her (it still works for me).

Any other suggestions much appreciated and we'll certainly give them a try.

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Hi Dave,

I got an email from my client and the problem seems to have been solved.

They wouldn't elaborate but I have a feeling it had to do with some extension that they were using, because I mentioned that concept and a while later I got the email.

Thank you again for taking the time to weigh in on this.

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php