You are here

README.txt in Login Destination 5

Same filename and directory in other branches
  1. 8.2 README.txt
  2. 8 README.txt
  3. 6.2 README.txt
  4. 6 README.txt
  5. 7 README.txt
Description
-----------------
This module controls where users go after logging in.
You can configure login destination on a settings page.

It will be either static URL or a PHP snippet evaluating your own site's logic.
You can also use alias URLs instead of internal paths.
If you want to redirect a user to an URL with a query (parameters specified in GET),
you should return an array instead of a string of the following format:
    return array('path' => 'node/add/video', 'query' => 'param1=100&param2=200');

You can also configure from which pages redirection is applied.
To achieve this you can specify either a list of URLs or a PHP snippet to build this list dynamically.
So, you can redirect user to various pages depending on which pages they are logging from.


Configuration
-----------------
All configuration is performed on an Administer -> User management -> Login destination page
(admin/user/login_destination).


Examples
-----------------

PHP snippet for redirection URL should return a string. Here is an example:

  global $user;
  if ($user->uid == 1) {
    // Redirect the Administrator
    return 'admin';
  } elseif ($user->uid == 2) {
    // Redirect the Site Owner to 'create video' page
    return array('path' => 'node/add/video', 'query' => 'param1=100&param2=200');
  } else {
    return 'node';
  }

PHP snippet for Redirection condition should return boolean value. An example is:

  return ($_GET['q'] == 'user/login');

Don't put PHP tags when creating snippets.

Turn on "Preserve destination" feature to make module sensible to destination parameter.
When login from the path with specified destination (ex: 'any-page?destination=node/18')
you will be taken to node/18 instead of the URL specified in login_destination settings.

$_SESSION['login_page'] was added and stores the page you were before clicking login form button.
You can use it to determine the page you logged from instead of $_GET['q'] because $_GET['q']
always equals to 'login_redirect'. 


Authors
-----------------
Moshe Weitzman <weitzman AT tejasa DOT com>
ARDAS group <info AT ardas DOT dp DOT ua>

File

README.txt
View source
  1. Description
  2. -----------------
  3. This module controls where users go after logging in.
  4. You can configure login destination on a settings page.
  5. It will be either static URL or a PHP snippet evaluating your own site's logic.
  6. You can also use alias URLs instead of internal paths.
  7. If you want to redirect a user to an URL with a query (parameters specified in GET),
  8. you should return an array instead of a string of the following format:
  9. return array('path' => 'node/add/video', 'query' => 'param1=100¶m2=200');
  10. You can also configure from which pages redirection is applied.
  11. To achieve this you can specify either a list of URLs or a PHP snippet to build this list dynamically.
  12. So, you can redirect user to various pages depending on which pages they are logging from.
  13. Configuration
  14. -----------------
  15. All configuration is performed on an Administer -> User management -> Login destination page
  16. (admin/user/login_destination).
  17. Examples
  18. -----------------
  19. PHP snippet for redirection URL should return a string. Here is an example:
  20. global $user;
  21. if ($user->uid == 1) {
  22. // Redirect the Administrator
  23. return 'admin';
  24. } elseif ($user->uid == 2) {
  25. // Redirect the Site Owner to 'create video' page
  26. return array('path' => 'node/add/video', 'query' => 'param1=100¶m2=200');
  27. } else {
  28. return 'node';
  29. }
  30. PHP snippet for Redirection condition should return boolean value. An example is:
  31. return ($_GET['q'] == 'user/login');
  32. Don't put PHP tags when creating snippets.
  33. Turn on "Preserve destination" feature to make module sensible to destination parameter.
  34. When login from the path with specified destination (ex: 'any-page?destination=node/18')
  35. you will be taken to node/18 instead of the URL specified in login_destination settings.
  36. $_SESSION['login_page'] was added and stores the page you were before clicking login form button.
  37. You can use it to determine the page you logged from instead of $_GET['q'] because $_GET['q']
  38. always equals to 'login_redirect'.
  39. Authors
  40. -----------------
  41. Moshe Weitzman
  42. ARDAS group