I have around 1000 users that were imported a while ago with the password hash used as the password. I am trying to update them by querying the cmsMember table as a source, using Update Record where member exist, Automatic Generate Password, and Email Credentials checked in hopes of generating new passwords for these users and emailing them their credentials. Unfortunately, this doesn't seem to generate a new password or email the credentials.
Other operations have been done on these members since the import by different people; so, I want to avoid removing them and re-importing.
Yes only newly updated members will get a new password and confirmation email. Otherwise all updated members will get new passwords and confirmation emails. This should only be the case on new imported members. What you could do is generate the password using Membership.GeneratePassword(Membership.MinRequiredPasswordLength, Membership.MinRequiredNonAlphanumericCharacters) in the RecordImported event (see page 37 of the manual )and then send the email yourself in case of an update.
This is kind of a special case/one off, so I ended up doing a user control instead. I figured it was about the same amount of work, but gave me a little more flexibility for doing updates in the future.
I'll likely use the RecordImported event for additional validation though. Is there a way to determine the member group the imported members are going to, or is it better to use a data adapter for that?
In case it helps anyone else, the gist of the user control was:
using umbraco.cms.businesslogic.member
Text box for where clause
Get Members button
Reset Password button
Grid View to review members
Get Members:
Select nodeid, loginname, email, passwordfunction() as "pass" from cmsMember + where clause
Populate grid view
Reset Password:
Foreach gridviewrow in gridview.rows
Member mem = new Member(int.parse(row.cells[0].Text))
mem.ChangePassword(row.Cells[3].Text)
mem.save()
Send email
It's fairly straight forward, but dangerous for the end users; so I removed the macro after I used it to ensure that it doesn't get used accidentally.
Thanks for the detailed reply. You mean for assigning members against a database column?You could use the RecordImporting event. This gives you the Member object and the items collection holding the data from the datasource so you can easily map that against the membergroups.
Force Generate Password on Member Update
Hi,
I'm using CMSImport Pro 2.1.1 on Umbraco 4.7.1.
I have around 1000 users that were imported a while ago with the password hash used as the password. I am trying to update them by querying the cmsMember table as a source, using Update Record where member exist, Automatic Generate Password, and Email Credentials checked in hopes of generating new passwords for these users and emailing them their credentials. Unfortunately, this doesn't seem to generate a new password or email the credentials.
Other operations have been done on these members since the import by different people; so, I want to avoid removing them and re-importing.
Is there an easy way to this?
Thanks,
-Chris
Hi Chris,
Yes only newly updated members will get a new password and confirmation email. Otherwise all updated members will get new passwords and confirmation emails. This should only be the case on new imported members. What you could do is generate the password using Membership.GeneratePassword(Membership.MinRequiredPasswordLength, Membership.MinRequiredNonAlphanumericCharacters) in the RecordImported event (see page 37 of the manual )and then send the email yourself in case of an update.
Sorry that there is no easy answer,
Richard
Hi Richard,
Thanks for the quick response.
This is kind of a special case/one off, so I ended up doing a user control instead. I figured it was about the same amount of work, but gave me a little more flexibility for doing updates in the future.
I'll likely use the RecordImported event for additional validation though. Is there a way to determine the member group the imported members are going to, or is it better to use a data adapter for that?
In case it helps anyone else, the gist of the user control was:
using umbraco.cms.businesslogic.member
Hi Chris,
Thanks for the detailed reply. You mean for assigning members against a database column?You could use the RecordImporting event. This gives you the Member object and the items collection holding the data from the datasource so you can easily map that against the membergroups.
Hope this helps,
Richard
is working on a reply...