Posted by RavindraSingh on August 22, 2012 at 3:01am
Example is below mentioned given
global $user;
$author = false;
foreach ($user->roles as $roleid => $rolename)
{
if (strtolower(trim($rolename)) == 'author')
{
$author = true;
break;
}
}
return $author;
Comments
Where you've
Where you've got:
<?php
$author = true;
break;
?>
Instead do:
<?php
drupal_goto('some/path');
?>
But, if you want to do multiple different redirects based on roles, and want to manage that configuration later, I would use Rules.
perfact
rules can be used as well.