duckling Posted February 5, 2012 Share Posted February 5, 2012 Hi, I have just started up a new shop and made a password reset to my admin account. However, the password email does not work, so I cannot reach my admin account again for the BO. No email is sent with the necessary info. So, what do I do to reset that password by force? Can I go in and do something in the DB (remove the user etc)? Cheers, Bjorn Link to comment Share on other sites More sharing options...
duckling Posted February 6, 2012 Author Share Posted February 6, 2012 I can see now that there is an error message: "Warning: mail(): Bad parameters to mail() function, mail not sent. in /hsphere/local/home/_myshop_details/tools/swift/Swift/Plugin/MailSend.php on line 160" This was received when I tried to get a new password. This is strange as I have tested and used the mail function, so it has worked before. If we can fix this, then I can of course retrieve a password.. Link to comment Share on other sites More sharing options...
El Patron Posted February 6, 2012 Share Posted February 6, 2012 This may help: http://forge.prestashop.com/browse/PSCFI-3590 Link to comment Share on other sites More sharing options...
bellini13 Posted February 6, 2012 Share Posted February 6, 2012 elpatron, nice find in bug tracker, but i think it may be slightly different. in the bug tracker, the email worked properly and the warning was just a false positive. in this case the user stated that the email is not working, since it is not being received. @duckling, do you have coding experience? if so, i would add some debug statements in the MailSend code and track what parameters are being passed to the function. you might find that something odd is being passed in. 1 Link to comment Share on other sites More sharing options...
duckling Posted February 6, 2012 Author Share Posted February 6, 2012 @bellini13: That might be a good idea, but I would need some guidance as to what kind of debug code should be added - I can certainly go in and modify the code as long as I know what you suggest. I guess I could set something up so that the paramters you are thinking of are given in a prompt/dialogue? Strange this really... I had a bit of a hurry and just assumed that the password reset function would work as it should - otherwise I would have looked harder for my note with the password........ Link to comment Share on other sites More sharing options...
duckling Posted February 6, 2012 Author Share Posted February 6, 2012 Another Q: What happens if I just remove the user from the DB directly? Link to comment Share on other sites More sharing options...
bellini13 Posted February 7, 2012 Share Posted February 7, 2012 since this is the admin account, you don't want to remove it manually from the database. the password reset functionality is in the admin/password.php file, around line 64 you will see $pwd = Tools::passwdGen(); $employee->passwd = md5(pSQL(_COOKIE_KEY_.$pwd)); $employee->last_passwd_gen = date('Y-m-d H:i:s', time()); $result = $employee->update(); this code is creating a new password for your employee, encrypting it and then storing it in the database. if your goal is to get the password so you can atleast log into the back office, then add the following into the right after that last line error_log('password is: '.$pwd); so it looks like this $pwd = Tools::passwdGen(); $employee->passwd = md5(pSQL(_COOKIE_KEY_.$pwd)); $employee->last_passwd_gen = date('Y-m-d H:i:s', time()); $result = $employee->update(); error_log('value is: '.$pwd); this will cause the password to be written to a php error log. typically the error log will be located in the admin folder. after doing this look for a file called error_log in the admin folder. make sure you remember to remove that line when you are finished. Link to comment Share on other sites More sharing options...
duckling Posted February 8, 2012 Author Share Posted February 8, 2012 HI Bellini13, That code did not generate that error log, so I guess it was not exectuted, or possibly it ends up somewhere else, but I could not find it. What do you think? Cheers! Link to comment Share on other sites More sharing options...
bellini13 Posted February 9, 2012 Share Posted February 9, 2012 you can try this approach instead. replace /var/tmp with a valid directory on your host. error_log('value is: '.$pwd, 3, "/var/tmp/my-errors.log" Link to comment Share on other sites More sharing options...
duckling Posted February 10, 2012 Author Share Posted February 10, 2012 No, that did not help either... I think that line is not executed. Something goes bad before that... Link to comment Share on other sites More sharing options...
duckling Posted February 11, 2012 Author Share Posted February 11, 2012 OK, No further suggestions - Reinstall the whole thing maybe ;-) It is strange that such a critical function does not work better. There also does not seem to be a way around this? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now