Created
September 11, 2013 16:44
-
-
Save raynimmo/12e7bdb08893ab752c88 to your computer and use it in GitHub Desktop.
Drupal: opting out of actions based on current users role. Can be used in page.tpl.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global $user; | |
if($user->roles[3] || $user->roles[4]){ | |
//dont track admins or moderators | |
} | |
if($user->roles[0] || $user->roles[1] || $user->roles[DRUPAL_ANONYMOUS_RID] || user_is_anonymous()){ | |
//track anonymous or regular users | |
} // endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment