Guest User

Untitled

a guest
Jul 19th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. function custom_module_user_login(&$edit, $account){
  2. if($acount->uid > 0) {
  3. $redirection = 'myview/'.$acount->uid;
  4. } else{
  5. $redirection = 'node/1';
  6. }
  7.  
  8. // Unless there is already a redirection going, or the user is trying to reset his password, we redirect to $redirection.
  9.  
  10. if (!is_null($redirection) && (!isset($_POST['form_id']) || $_POST['form_id'] != 'user_pass_reset')){
  11. $_GET['destination'] = $redirection; // Should we use $edit['redirect'] instead..?
  12. $GLOBALS['destination'] = $redirection; // Should we use $edit['redirect'] instead..?
  13. }
  14.  
  15. if($logged_in){
  16. drupal_goto('dashboard');
  17. }
  18.  
  19. if($logged_in && request_path() != 'myview/uid'){
  20. drupal_goto('myview/uid');
  21. }
  22. if(!$logged_in && request_path() != 'node/1'){
  23. drupal_goto('node/1');
  24. }
Add Comment
Please, Sign In to add comment