I want to hook into the registration module. I already have a database of 50000 users who use my old website. Now I am migrating to Drupal.
I still haven\'t migrated the
Here are some examples for Drupal 7:
/**
* Implements of hook_user_insert().
*/
function foo_user_insert(&$edit, $account, $category) {
// foo_user_submit($edit, $account);
}
/**
* Implementation of hook_user_delete().
*/
function foo_user_delete($account) {
// foo_user_delete($account);
}
/**
* Implements hook_form_FORM_ID_alter().
* Form ID: user_register_form
*/
function foo_form_user_register_form_alter($form, &$form_state) {
if ($form['#user_category'] == 'account' && !isset($form['#user']->uid)) {
// Foo code
}
}
/**
* Implements hook_form_FORM_ID_alter().
* Form ID: user_profile_form
*/
function foo_form_user_profile_form_alter($form, &$form_state) {
// Set a custom form validate and submit handlers.
$form['#validate'][] = 'foo_account_validate';
$form['#submit'][] = 'foo_account_submit';
}
/**
* Implements of hook_form_alter().
* This is the same as: hook_form_FORM_ID_alter()
*/
function foo_form_alter(&$form, $form_state, $form_id) {
switch ($form_id) {
case "user_profile_form":
case "user_register_form":
break;
}
}