Login Destination
The Login Destination module provides a way to customize the destination that a user is redirected to after logging in, registering to the site, using a one-time login link or logging out.
Drupal 7
Settings are found under Configuration >> Login Destination(admin/config/people/login-destination)
The configuration consists of specifying so called login destination rules that are evaluated when the login or logout takes place. Those rules are evaluated against certain conditions and the user is taken to the destination specified by the first matching rule. If the destination is empty, no redirect is performed aka user is taken to the default destination. You can define pages from which a user logs in/out to be a matching criterion. You can also select certain user roles that are matched against those of a user. Note that only one role has to match in order for the redirect to take place. If no roles are selected the redirect is performed regardless of user roles. You can also provide your own conditions by specifying PHP snippets (the PHP Filter has to be enabled). The snippet should return TRUE if the condition matches and FALSE otherwise.
Read moreCustomizing and Overriding User Login page, Register, and Password Reset in Drupal 6 and 7
Customizing the user login, register, and password reset pages is fairly simple, and uses the following concepts:
- preprocessing to set variables
- registration of functions in the theme registry
- creation of one or more theme templates.
Step 1.
In the site theme directory, create or edit your template.php file.
Step 2.
The first step is to implement hook_theme for your theme. In the template.php file for your theme, look for a function named yourtheme_theme() and modify it to add these return values. If the function doesn't exist, add the following:
For D6:
<?php
/**
* Registers overrides for various functions.
*
* In this case, overrides three user functions
*/
function yourtheme_theme() {
return array(
'user_login' => array(
'template' => 'user-login',
'arguments' => array('form' => NULL),
),
'user_register' => array(
'template' => 'user-register',
'arguments' => array('form' => NULL),
),
'user_pass' => array(
'template' => 'user-pass',
'arguments' => array('form' => NULL),
),
);
}
?>Notes about that code:
- Change the function name by replacing "yourtheme" with the name of your theme