Drupal Block Visibility: Check Role


/ Published in: PHP
Save to your folder(s)

From Drupal 5 Themes book.


Copy this code and paste it in your HTML
  1. <?php
  2. global $user;
  3. if (in_array('Moderator',$user->roles)) {
  4. return TRUE;
  5. }
  6. else {
  7. return FALSE;
  8. }
  9. ?>

URL: http://www.packtpub.com/drupal-5-themes/book

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.