Hi All,

I can't quite figure out the correct PHP snippet that's required to get the Login Destination module to redirect users to the Workspace module. In other words, I would like Workspace to be the logged-in-user's home page (or dashboard).

Can anyone help with the correct PHP snippet? or an alternative method if available?

Drupal 6.13
Apache 2.2.11
PHP 5.2.9
MySQL 5.1.30

Thanks in advance... Jack

Comments

jcklabatt’s picture

I'm still receiving an error when trying to log in: "Page not found". In the Login Destination module, the settings are:

Preserve destination (unchecked)
Static URL (checked)
URL: "workspace" (logged in users are redirected to Workspace module)

Redirection condition settings
Always (checked)

Is "URL: workspace" correct? Any help would be much appreciated.

Thanks,
Jack

Diegen’s picture

hmmm

redirect condition: checked

destination url: what you need here it the users workspace. workspace itself would give you a 404 probably, your looking for workspace/%

if (user logged in) {
print workspace url user id;
}

maybe something like

if ($user->uid) {
print . $base_url . '/workspace/' . $user->uid;
}

bradspry’s picture

Redirection conditions: always
Destination URL settings: uncheck Return user, checked PHP snippet

URL:
global $user;
return "workspace/$user->uid";