Created
October 5, 2013 18:21
-
-
Save raynimmo/974e2dbfc73e4e6b1a30 to your computer and use it in GitHub Desktop.
redirect a user after login to a specific page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_user_login(). | |
*/ | |
function mymodule_user_login(&$edit, $account) { | |
$current_path = drupal_get_path_alias($_GET['q']); | |
// If the user is logging in from the 'example' page, redirect to front. | |
if ($current_path == 'example') { | |
$_GET['destination'] = '<front>'; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment