Here is a patch agains dev version of date, that implements some of the requests been here lately plus some more. The patch includes:

  • corrected code style to conform with drupal code standard (done by coder module)
  • Added support for PostgreSQL. This code is NOT tested as I don't have it but looked closely on other examples. At least better then nothing.
  • Allow email as username from http://drupal.org/node/139500
  • Support for Existing users from http://drupal.org/node/93157
  • Support for alternate import (reuse) of username or compose as before. Import file can contain both
  • Set user registration (created) and access date as discussed here http://drupal.org/node/75756
  • Changed the 'Activate Accounts' setting to correctly (in my view) apply to if account has status Activated/Blocked

comment regarding the 3 latest above. In the fields dropdown there are now 3 new fixed options

Reuse Username: if an imported field is linked with it it explicit use the username "as is", if empty it uses the combining technic as before. So you can import both fixed usernames and/or create new ones from same file.

User Created: if a correct timestamp value is given ( < Now AND > -1 ) 'created' is for the imported user.
User Last Access: if a correct timestamp value is given (-1 OR (< Now AND > -1 )), 'access' && 'login' is set. A value of -1 equals 'created' date, usually Now() others according to the timestamp. Access cannot be before created though.

The above 2 replaces the old "Activate accounts" and makes it more flexible as it can be set individually. It also gives a natural place for Status = Active/Blocked (which previously was hardcoded to Active)

I also changed the hard coded timezone to 0 (GMT) as I think that's more "correct". As the patch also introduce 1 new field you need to run update.php as well

I hope this will come handy for someone. I needed it done and the maintainer (Robert) seem to be busy or absent with other things at the moment, but if you find this usefull, please feel free ti use it.

CommentFileSizeAuthor
user_import_0.patch31.38 KBvikingew

Comments

mshaver’s picture

Thanks for the patch. I had patched my 4.7 copy of this module to include a few of these features, but then needed to upgrade to 5.2. All seems to be working fine. I did notice that on line 875 it still has the $form['options']['update_profile'], instead of including it within the fieldset ['optional']. Why was the fieldset changed in the first place? And will this affect the code in other places?

mshaver’s picture

It seems like there are some strange things happening with the FTP files being deleted from the server without prompting? Is it possible that if you delete a file, then upload another file with the same name as the deleted file, that it will attempt to delete this file as well?

robert castelo’s picture

Status: Needs review » Closed (won't fix)

Most of these features have been implemented in the 5.x.2 branch, and the patch no longer applies, so I'm closing this issue.

Note - each feature should be submitted in a separate issue.