When deploying users, user passwords are not preserved.
I've looked into code and this appears to be a limitation that comes from the fact that deploy module uses services module, which in turn uses drupal_execute on either "user add" or "user edit" forms.
So, on one hand you got the md5 password with no way to regain the password in clear, and on the other hand you got the services module which wants to execute a form with the password typed in clear.
The quick fix for this must be that we set a standard password and expect the users to change it.
Long term solution is to use a custom module on the destination server to do the md5 saving straight to database.
Feedback anyone?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | deploy.newuser.patch | 444 bytes | brad.bulger |
Comments
Comment #1
pokadan commentedCurrently what happens is that user passwords get re-hashed(md5(md5(pass)) (if user does not exist on destination server).
If the user exist on destination server, not even using the initial hash from source server does not get you logged in the destination server.
Comment #2
gddThis SHOULD not be true. There is code in lines 206-211 of deploy_uuid.module to handle this very situation. (It manually sets the double-md5'd password back to the one that was originally sent.) Can someone verify that this is or is not working? Note that you must actually have deploy_uuid.module enabled on the dest server.
Comment #3
pokadan commentedOK, I've seen the code, but it happed to me. The only way to login after a user deployment, was to provide the hash from original database thus having the system perform an md5(md5(pass) to get match.
Comment #4
gddIf someone can come up with repeatable steps to reproduce this I'm happy to look at it. Closing until then.
Comment #5
archvan commentedI am also facing the same problem. Deployment rehashes user password when users are deployed to destination server. Has anyone found any solution.
Comment #6
brad.bulger commentedi am able to recreate this without trouble - add a new user account, switch to the new user, create a node, and deploy the node. i put a dd() call into deploy_uuid to see what was happening there, and it looks like the problem is that it is expecting $account['deploy'] to be set, and it isn't, so the password update is not done. this is the account record it saw in my test:
i also had the user_service_save() function dump out the data that was being sent to it, and the 'deploy' value is there as it ought to be. so it looks like that 'deploy' value is being filtered away out of the account data at some point in its passage through the wilds of the user module, though i haven't tracked down exactly where or why yet.
Comment #7
brad.bulger commentedi updated the deploy_uuid_form_alter() function to add a hidden field named "deploy" and that does the trick. there might be some other way to do it, or you might want to use a different name - i just needed to get it working in the short term.
Comment #8
dixon_I can confirm this bug by following the steps in #6. I can also confirm that the path in #7 does the job. And that's good enough for me. Committed!
Thanks brad.bulger for a good description of the problem, and the patch! Much appreciated!