Return to Snippet

Revision: 11835
at February 21, 2009 02:53 by arul20


Initial Code
<?php

  global $user;

  // Check to see if $user has the administrator role.
  if (in_array('administrator', array_values($user->roles))) {

    // Do something.

  }

?>

Initial URL


Initial Description


Initial Title
Drupal Checking if logged in user is admin

Initial Tags
drupal

Initial Language
PHP