| Drupal

Login Destinations ModuleLogin Destination is a module that allows you to specify which page the user sees after logging in. One very common use is to redirect users to the page they were viewing before they logged in.

Login Destination is available for both Drupal 6 and 7. In this tutorial we cover D6 because that is the version used by the student who requested this tutorial. However, the only difference for D7 users will be the installation process.

Step 1. Download and install the module

tutuploadstutuploadsStep_1_fc3bedd806840017efdd936d12a58e2a.png

Step 2. Enable the module

tutuploadstutuploadsStep_2._Enable_the_module_877c8697e7030721fb34810128a5fc76.png
  • Go to Administer then Site Building then Modules.
  • Check the Enabled Box.
  • Click Save configuration.

Step 3: Adjust permissions

tutuploadstutuploadsStep_3_Adjust_permissions.png

Go to Administer then User management then Permissions to change permissions.

You only need to do this if you want registered users other than the top level administrator to have access to this module.

Step 4. Configure the module

tutuploadstutuploadsStep_4._Configure_the_module.png
  • Go to Administer then User management and finally then Login Destination to find the configuration page.
tutuploadstutuploadsmedia_1326575434057.png
  • Notes: Always: Redirection happens always. Redirect condition field is ignored.
  • List of paths mode: Enter a list of paths, one path per one line. Redirection will happen only when logging from specified pages. Example paths are contact or user/login.
  • PHP snippet mode: Enter PHP code if you need to do calculations to detemine if the user should be redirected (if they are assigned to a certain user role, for example). It should return either a string value or an array and PHP opening and closing tags are not required.
tutuploadstutuploadsmedia_1326575455854.png
  • Notes: Static URL mode: Enter a static path. Do not use a GET query at the end here. Only the first line of text will be used. Example paths are node/add or contact.
  • PHP snippet mode: Enter PHP code if you need to do calculations to detemine where the user should go (a personalised URL, for example). It should return either a string value or an array and PHP opening and closing tags are not required.
  • The simplest and method is to simply check the box that says, "Return User to his/her destination"