function login_destination_redirect returning fatal error undefined function drupal_eval() when using php snippet
| Project: | Login Destination |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
If I put in a static url (i.e. 'dashboard') then the module works as it should; however, when I put in the following php snippet:
global $user;
if (in_array('role1', $user->roles)) {
// Redirect users will translator role
return 'role1 url';
} elseif (in_array('role2', $user->roles)) {
// Redirect users will role2 role
return 'role 2 url';
} else {
return 'default url';
}then I get the following error on submit from the user login form:
Fatal error: Call to undefined function drupal_eval() in /home/corp/public_html/sites/all/modules/login_destination/login_destination.module on line 110
I realize that this is probably something to do with calling a function twice or headers; but I am not familiar with the issues surronding drupal_eval and it's interaction within login destination. Could you provide some guidance?
Also, if it matters, I am using a custom login page. But, again, everything works fine if I use a static url.
Thanks, in advance, for your attention.

#1
I should mention that the php snippet referenced above is not the exact one I use. I do put in the appropriate user roles and urls. I just replaced them with placeholders for this support request.
#2
Hi,
i am not sure whether this is the right place to put this forum
But i have a problem with LOGIN DESTINATION redirection.
My codeis as follows:
global $user;
if ($table->value ='abc')
{
return 'node/add/abc';
}
else
{
return 'user';
}
where table is a table from database and value is a field of the database.
but the if--else code does not work here,
Thankyou.