A manual "goto" like link to sign a person in and redirect them to that page...?

esend7881 - May 30, 2009 - 17:16
Project:LoginToboggan
Version:6.x-1.5
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi,

In my set up, I create theme files where I manually check what the user's roles are. If their roles aren't right, I don't allow them to see a certain page.

so like:

global $user;
if ($user->uid = ....) {
  //...show stuff...
}
else {
  //redirect to a login page, and that login page will redirect them back here.
}

So I know I can use drupal_goto and just redirect them to '/user/login'

But is there a special way to redirect the user to the logintoboggan screen that will, after logging in, redirect the user back to the previous page?

Thanks!

#1

hunmonk - October 11, 2009 - 19:34
Status:active» fixed

you need to check out these functions:
drupal_goto()
drupal_get_destination()

find them for your drupal version at http://api.drupal.org

#2

System Message - October 25, 2009 - 19:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.