Forwarding username drupal

Hi, I wrote a module for creating custom pages. After logging in, the path goes to users / [username], and I want to configure it using my module. how to handle this?

+3
source share
4 answers

You can use Login Toboggan to set the login destination. There are several modules available for name forwarding without the need for code.

To customize the appearance of the user profile page, you can implement this using TPL using CSS or you can use Views to create content panels in combination with panels and override the user profile view /%.

+3
source

hook_form_alter $form_state['redirect'] , , .

+2

You can implement a hook_user framework like this

function mymodule_user($op, &$edit, &$account, $category=NULL) {
 switch ($op) {
  case 'login':  // user just logs in...
                        // Modify $_REQUEST['destination'];
                        // but no drupal_goto in order 
                        // to avoid problem with other hook
   break;
 }
}

Read more here: http://www.youtube.com/watch?v=UoeFTr124jw

+2
source

Yes, you can do this and more with Login Toboggan, but if you just want to redirect to where users will be sent after logging in, try the Login Destination module: (D6 and D7)

+2
source

Source: https://habr.com/ru/post/1749163/


All Articles