Redirect user based on role and node content I want to redirect a user when they login based on what role they have and whether they have created a node of a type.

So if the user has administrator role, direct user to admin url 
else if 
the user has role list_user, check if user has content of type new listing, if they don't, direct them to create node listing if they do have created node of type listing, direct them to profile.

I have this set up in separate rules but I'm sure it will work better and faster by just having one php block of code in the template.php

My only problem is, I don't know php and everything I've tried doesn't work very well or not at all.

Any help would be appreciated.
Use Rules module to redirect based on user roles.


After Installing Rules module, Go to Admin -> Configuration -> Rules (admin/config/workflow/rules/)
Add new rule
Enter rule name &amp; select User has logged in from React on Event
Add new condition and set User has Role Select the required role and Save
In Action add new action Set it Page Redirect &amp; enter the redirection URL