Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function custom_module_user_login(&$edit, $account){
- if($acount->uid > 0) {
- $redirection = 'myview/'.$acount->uid;
- } else{
- $redirection = 'node/1';
- }
- // Unless there is already a redirection going, or the user is trying to reset his password, we redirect to $redirection.
- if (!is_null($redirection) && (!isset($_POST['form_id']) || $_POST['form_id'] != 'user_pass_reset')){
- $_GET['destination'] = $redirection; // Should we use $edit['redirect'] instead..?
- $GLOBALS['destination'] = $redirection; // Should we use $edit['redirect'] instead..?
- }
- if($logged_in){
- drupal_goto('dashboard');
- }
- if($logged_in && request_path() != 'myview/uid'){
- drupal_goto('myview/uid');
- }
- if(!$logged_in && request_path() != 'node/1'){
- drupal_goto('node/1');
- }
Add Comment
Please, Sign In to add comment