Hacking in Drupal Login

I have a lot of experience with PHP, etc. but new to Drupal. I would like to know if there is a way in which I could add additional PHP code after the user logs in to the Drupal website. The reason I need to do this is to update the fields in another database (and not in MySQL Drupal DB). I will need to have access to the Drupal website login username and the session cookie created by drupal. I would really appreciate any help.

+3
source share
2 answers

Create a module and use hook_user to check the login action.

If your module name is mymodule, then create a function called

mymodule_user($op, &$edit, &$account, $category = NULL) {
  if ($op == 'login') {
    // Perform your task.
  }
}

: hook_user

+8

$user hook_user, .

0

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


All Articles