Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $name = $entity->title; //fill it with what field you want
- $email = $entity->YOUR_EMAIL_FIELD_MACHINE_NAME['und'][0]['value'];
- $pass = $entity->YOUR_PASS_FIELD_MACHINE_NAME['und'][0]['value'];
- $new_user = array(
- 'name' => $name,
- 'pass' => $pass, // note: do not use md5
- 'mail' => $email,
- 'status' => 1,
- 'init' => $email,
- 'roles' => array(
- DRUPAL_AUTHENTICATED_RID => 'authenticated user',
- ),
- );
- // The first parameter is sent blank so a new user is created.
- user_save('', $new_user);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement