Page 1 of 1

password changes on import

PostPosted: May 16th, 2011, 6:19 am
by kentlii
Several times per week we export and import the users, because we update the points on their profile. But it seems that every time we import the users, their password is changed, so they have to generate a new password access their profile.
Is there any way we can avoid changing the password when importing the csv file?

Re: password changes on import

PostPosted: May 16th, 2011, 12:01 pm
by Cristián Lávaque
Jason Caldwell wrote:Importing a new user with the password field empty will result in an auto-generated password. However, importing updates to an existing user ( i.e. when the ID field is included in the importation line ), this will result in the existing password, for the existing user, remaining unchanged. This is the intended functionality. This is also why the password is not included in the export file.


From what Jason explains, if you're just updating the user accounts including their IDs and leaving the password field empty, the password should not be changed.

Let me know if that helps.

Re: password changes on import

PostPosted: May 17th, 2011, 2:30 am
by kentlii
I do an export and change only one column which is a custom column and then import again. But after this is done, every time I can see the users all using the forgot password function. It is not changed for admins, but they are not changed when importing the csv file.

Re: password changes on import

PostPosted: May 17th, 2011, 12:32 pm
by Cristián Lávaque
Got it. Thanks for reporting that. I'll show it to Jason in case it's a bug.

Re: password changes on import

PostPosted: May 18th, 2011, 3:29 am
by Jason Caldwell
Thanks for reporting this important issue.
~ yes, this does appear to be a bug when running against the latest version of WordPress®.

I'm having this corrected in the development version ( to be released in a few days ).
Until then, you can use this patch file if you like. This file will patch an existing installation of s2Member Pro v1.5.8. Please unzip, and upload the attached file; let it overwrite your existing copy of:
/s2member-pro/includes/classes/imports-in.inc.php

Section changed:
Code: Select all
$user_details = compact ("ID", "user_login", "user_pass", "first_name", "last_name", "display_name", "user_email", "user_url", "role", "user_registered");
    if (empty ($user_details["user_pass"])) /* If there was NO Password given. */
        unset ($user_details["user_pass"]); /* Unset the Password array element. */ 

Re: password changes on import

PostPosted: June 5th, 2011, 8:58 pm
by Jason Caldwell
This issue was corrected in the official release
of s2Member Pro v110605+ ( available now).

http://www.s2member.com/