Posted By

jmaties on 10/18/10


Tagged

drupal rol


Versions (?)

Redireccion por ROLE (Drupal)


 / Published in: PHP
 

  1. global $user;
  2. $adminRoles= array('monitor','editor');
  3. $adminAble= FALSE;
  4. foreach($adminRoles as $role) {
  5. if( in_array($role, array_values($user->roles)) ) $adminAble= TRUE;
  6. }
  7. if($adminAble) {
  8. return inicio;
  9. } else {
  10. return user;
  11. }

Report this snippet  

You need to login to post a comment.