$CURRENT_USER is not working properly.
I've got a page where I'm trying to load in the current user's fullness, email and phone number stored in their profile. But nothing I do seems to work and $CURRENT_USER works in reverse as well.
For example - the line of code below is presently seen by users who are logged out, but notice the bold ! which should do exactly the opposite from my understanding.
<?php if (!$CURRENT_USER): ?>
<h3 style="margin-top:24px;">USER Logged In</h3>
... AND the line of code below is seen by those who are logged in
<?php if ($CURRENT_USER): ?>
I'm trying to pre-populate three of the fields with the logged in "USER" profile data entries using the code below, and no matter which setting I apply above, no data gets plugged into the fields.
<input name="registrant_name" value="<?php echo $CURRENT_USER['fullname'] ?>" size="24"><div>Name</div>
<input name="registrant_email" value="<?php echo $CURRENT_USER['email'] ?>" size="24"><div>Email</div>
<input name="registrant_phone" value="<?php echo $CURRENT_USER['phone'] ?>" size="24"><div>Phone</div>
The code I'm using works perfectly in CMS Builder V2.61, but does seem to work in CMS Builder V2.65.
I think I've worked out what the issue is; the server doesn't allow sharing of cookies between HTTP and HTTPS.
If you look through your phpinfo and search for session.cookie_secure, you'll see that this option is enabled locally.
I'd contact your host and ask them if they can disable session.cookie_secure, then you'll be able to use the current_user variable on both protocols.
PHP Programmer - interactivetools.com