if CURRENT_USER not admin

6 posts by 2 authors in: Forums > CMS Builder
Last Post: July 31, 2017   (RSS)

By dlsweb - July 31, 2017

I'd sure appreciate someone telling me how to format this if
if $CURRENT_USER not admin

Thanks

By Djulia - July 31, 2017 - edited: July 31, 2017

Hi,

if ($CURRENT_USER['isAdmin'] == '0') { echo 'not admin; }

if ($CURRENT_USER['isAdmin'] == '1') { echo 'is admin; } else { echo 'not admin; }

Djulia

By dlsweb - July 31, 2017

thanks, I was trying to have a member modify a system field (hidden) that I guess can't happen.

By Djulia - July 31, 2017

Can you test that?

<?php $CMS_USER = getCurrentUserFromCMS(); ?>

<?php if($CMS_USER['isAdmin'] == '0'): ?>
  <input type="hidden" name="pending" value="1" />
<?php endif; ?>

By dlsweb - July 31, 2017

oh my YES - thanks so much for your help.