CMSB Acting Weirdly

16 posts by 4 authors in: Forums > CMS Builder
Last Post: August 19, 2016   (RSS)

Hi northern penguin,

I've also come across a similar issue before, in my case the server was using cloud flair for caching the pages. Cloud flair was caching the pages from when the user was logged in after they had logged out. Is your hosting running any type of caching service? 

For some reason Websitemembership plugin won't let me logoff this page (minutes).  It does actually logoff, but the value of $CURRENT_User['position'] is still "director", so it displays the BOD Minutes, which it shouldn't.

How are you able to tell that the user is logged off? Is it because users are not able to access pages which require the them to be logged in?

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

When I login as a user, and go to the minutes.php page, I see all the BOD Minutes.  When I logoff, nothing changes, however if I try to go to the profile.php page, I am told that I am not logged in.

If I display $CURRENT_USER['position"], the value is "Director".  It shouldn't be.

--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

This sounds like it's specific to the BOD Minutes page then. Is the $CURRENT_USER['position'] variable set in the users account, or is it set in a variable in the BOD minutes file? Would it be possible to add the code for the BOD Minutes page in a post for me?

Greg Thomas







PHP Programmer - interactivetools.com

The $CURRECT_USER['position'] is defined per user in their specific account.  I have attached the file minutes.php

--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke
Attachments:

minutes.php 10K

I've found the problem, on line 146 you have the following code:

<?php if ($CURRENT_USER['position'] == 'SiteAdmin' || $CURRENT_USER['position'] == 'SiteAdmin/Director' || $CURRENT_USER['position'] = 'Director' ): ?>

This line needs needs another equal sign adding to validate the position:

<?php if ($CURRENT_USER['position'] == 'SiteAdmin' || $CURRENT_USER['position'] == 'SiteAdmin/Director' || $CURRENT_USER['position'] == 'Director' ): ?>

At the moment the code is setting the position to Director, not checking if it matches the value. 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By northernpenguin - August 19, 2016 - edited: August 19, 2016

Greg:  Works!

Thanks Greg

--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke