Показывать/не показывать блок роли



Показывать блок роли authenticated user

<?php
global $user;
if (
in_array('authenticated user',$user->roles)) {
  return
TRUE;
} else {
  return
FALSE;
}
?>

Не показывать блок роли authenticated user

<?php
global $user;
if (!
in_array('authenticated user',$user->roles)) {
  return
TRUE;
} else {
  return
FALSE;
}
?>

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.