Why does $logged_in appear to work opposite how it appears it should when logged in as admin?

Events happening in the community are now at Drupal community events on www.drupal.org.
texas-bronius's picture

See my code snippet and devel kpr() output:

<?php
function kresher_preprocess_node(&$vars, $hook) {
  if (!
$logged_in) {
   
kpr($vars);
   
$node = $vars['node'];
   
$node->field_story_body = '<p>You have to be subscribed to this website to see Premium Content. Sign up now?</p>';
  }
  ...
?>

I'm still trying to figure out how to hide or substitute the cck field's content before it's added to $content, but that's another matter. I just want to know why kpr() is spitting out $vars for me, and even showing $logged_in == TRUE for authenticated admin when my test should be demonstrating exactly the opposite: that only when $logged_in == FALSE should kpr() show (which of course it won't but you know what I'm getting at)..

Thanks, Merry Christmas!
-Bronius

AttachmentSize
kpr-logged-in-true.png9.67 KB
not-logged_in-works-not.png20.97 KB

Comments

did you mean

neclimdul's picture

did you mean $vars['logged_in'] ?

..... :| ...

texas-bronius's picture

oh.
Right..
Thanks for the extra pair of eyes!

Houston Drupal Users Group

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: