User Import: bizarre behaviour
Hello,
I'm trying to import a CSV file filled with new user information from a location on the server into the Drupal system. But user_save keeps trying to log me in for every new user I add, breaking the import process.
Background:
So I've written a function that fetches the files in a certain folder, converts them into an array, and runs the _user_import_process function, which is the same function used on the form_values of the usual user_import page.
The issue:
The inputs coming into _user_import_process from my function, and those that come in normally through the website user import form are exactly identical. And yet, when I try to import a CSV file using my function, it breaks.
I looked into further, and what happens is that the process breaks after running 'user_save('', $new_user_info)' within the _user_import_process function. Apparently, what's happening is that while you're trying to create the new user, the Drupal system logs this new user in. And yet, with identical input from submitting the form, this doesn't happen.
My questions:
1) How is this happening? And how can I use the user_save function without logging them in?
2) The user_import module says that it has a straightforward way of importing users from an FTP uploaded CSV, which the end goal of this project. However, I can't find documentation on this anywhere. Does anyone have a clue on how to do this?
Muchly appreciated,
Hassan
