Jump to content

Recommended Posts

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

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

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.

  • Like 1
Link to comment
Share on other sites

@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........ :angry:

Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...