Tuesday, February 04, 2014

How to reset Admin password in Prestashop? | PrestaShop Documentation Blog By Invertus

How to reset Admin password in Prestashop? | PrestaShop Documentation Blog By Invertus



Reset Prestashop Admin PasswordIf you lost your Prestashop admin password you can reset it in many ways but sometimes it’s not so easy to accomplish it as it may seem.
Today I will explain main three methods how you can change your lost password – one is really easy and quick :) .

Introduction
Prestashop saves all passwords encrypted – not in plain text. So there is no possibility to view them in a database. This ensures better security. OK lets find out how it is possible to reset users passwords.

1. Reset your password by email
Prestashop allows to reset your password by email but this method may not work all the time. You can find more information about configuring Prestahop email settings here.
Ok go to your back office login page and click “Lost your password?” link:

Lost your password screen
Lost your password screen
Enter your user’s email and click Send:
Entery your user's email
Enter your user's email
If mail was sent successfully you should see this screen:
Password sent Successfully
Password sent Successfully
Now check your inbox. If you do not see email with new password, check your inboxspam area. If you still can’t find email with new password, then something went wrong. If you’ll try to resend password one more time you will get this error:
You can regenerate your password only each 360 minute(s)
You can regenerate your password only each 360 minute(s)
UPS – we can’t wait so long and the password was changed also so you can stop trying to remember it.
If your Prestashop email configuration is wrong and your server does not allow to usemail() function then you may get such error: “Error occurred when sending the e-mail.” You can read more about how Prestashop sends emails here.
OK there are other solutions if the first one does not help. Keep reading.

2. Reset  password with our “invertus_passwd_reseter.php script.
Notice: This script has new features and you can read about them here. The link did not change so you can download this script form the link provided in this post.
This method is the fastest one – you’ll need 2 minutes if you have FTP access.
I wrote simple script to reset user passwords as I need it constantly. It helps when it is urgent o reset password and access system. Usually I don’t have access to users email so I can’t reset password  by email. Sometimes even phpMyAdmin is not installed.
Download our PHP script from here: invertus_passwd_reseter.rar. It is tested with Prestashop 1.3 and 1.4 versions.
Extract this archive and you will find invertus_passwd_reseter.php file. If you want to check it then open it with some text or PHP editor. The code is commented and easy to read.
Upload invertus_passwd_reseter.php to your server where Prestashop is installed – to Prestashop root directory.
Now open this link www.yourshoplink.tld/invertus_passwd_reseter.php. You will see this page:
Select your user's email
Select your user's email
Select your user’s email and press Submit. And that’s it. Your new password will be:aaa333aaa
Updated: 2011-07-02
Now password resetter can backup old passwords (save in txt file emails and passwords) and recover them (upload txt file). It is very convenient because I can reset password, do my job and recover back the old customer password – customers do not have to change their passwords.
3. Reset  password with phpMyAdmin.
First off all you need to access your phpMyadmin if it is installed. You can ask your system administrator or install it manually. If you decided to install it by your self then read this post: “How to install phpMyAdmin?
OK we need one more thing: _COOKIE_KEY_. This parameter is unique to every shop and is saved in config/settings.inc.php file. Find it and copy to some text file – you’ll need it.
When phpMyAdmin is ready and you have _COOKIE_KEY_ we can start resetting user password.
Login to your phpMyAdmin and find your database – it is located in the left side of phpMyAdmin:
Select your database
Select your database
Now find table ps_employee. Table prefix ps_ may be different. Select ps_employeetable and click on pencil icon in the line where your user’s email is entered:
Edit emplee - user.
Edit emplee - user.
You should see this form:
Enter new password
Enter new password
Enter _COOKIE_KEY_ and your new password in to the field passwd (column value).Your passwd string should look something like:
bV0C71uVJYZFTVwC4RP17CKbfrc5hmUd6AL4Rx42TcQRTB30wxOLKWdAmynewpassowrd
As you can see _COOKIE_KEY_ goes first and your password goes next.
Chose function MD5 (column Function).
Press Go.
That’s it. Now go to your back office login page and try to login with the new password. It worked for me with Prestashop 1.3 and 1.4 versins :) .
3. You still cannot access your back office?
Read this post.
If you have questions write them to donatas@invertus.lt.