Berikut ini saya tuliskan artikel mengenai cara melakukan reset password pada admin prestashop, semoga bermanfaat.
If 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.
Ok go to your back office login page and click “Lost your password?” link:
If mail was sent successfully you should see this screen:
Now check your inbox. If you do not see email with new password, check your inbox spam 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:
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 use mail() 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 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.
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:
Now find table ps_employee. Table prefix ps_ may be different. Select ps_employee table and click on pencil icon in the line where your user’s email is entered:
You should see this form:
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 versions.
4. Check your __PS_BASE_URI__ parameter in settings.inc.php file
Your PrestaShop is installed in web server root directory or sub directory. If you moved your shop to other directory then __PS_BASE_URI__ is incorrect and you will not be able to log in to your back office anymore. Or you could change this parameter accidentally.
Find file /config/settings.inc.php. Open it with text editor and check __PS_BASE_URI__ parameter. If your PrestaShop is located in a sub directory then it should look like this:
define('__PS_BASE_URI__', '/your_sub_directory_name/');
If it is in web server root directory then it should look like this:
define('__PS_BASE_URI__', '/');
It helped to me but if you still cannot access your admin admin then go to next stepl
5. Hack your PrestaShop (you’ll need FTP access)
It’s not actually a hacking because you’ll need access to your PrestaShop php files but it will allow you to access PreStashop back office with correct email and any at least 5 symbols random password – PrestaShop checks password length before authentication.
This method is unsecure because anybody will be able to login with correct email and any long enough password.
OK find the file: your_admin_folder/login.php.
Find line:
$employee = $employee->getByemail($email, $passwd);
Change it to:
$employee = $employee->getByemail($email, null);
Now try to login with correct email and at least 5 symbols random password. It worked for me – tested with PrestaShop 1.4.2.5 and 1.4.3.0
As I mentioned before this method is not actually hacking but it may be used for malicious purposes also
Updated 2011.07.02:
Well there is one more reason that can cause this problem – PHP bug: https://bugs.php.net/bug.php?id=42523
This problem was also reported to PrestaShop: http://forge.prestashop.com/browse/PSCFI-1110
If your PHP installation has this bug then $_SERVER['PHP_SELF'] variable will return the wrong value which is used in cookie path calculation.You can find this line in your admin folder/login.php file (54 line i PrestaShop 1.4.3.0):
$cookie = new Cookie('psAdmin', substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__), -10));
Change this line to:
$cookie = new Cookie('psAdmin', substr($_SERVER['SCRIPT_NAME'], strlen(__PS_BASE_URI__), -10));
It resolved the problem for me.
Hope you liked this post. Feel free to comment or suggest ideas for new articles
If 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.
Ok go to your back office login page and click “Lost your password?” link:
Enter your user’s email and click Send:
If mail was sent successfully you should see this screen:
Now check your inbox. If you do not see email with new password, check your inbox spam 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:
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 use mail() 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 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.
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:
Now find table ps_employee. Table prefix ps_ may be different. Select ps_employee table and click on pencil icon in the line where your user’s email is entered:
You should see this form:
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 versions.
4. Check your __PS_BASE_URI__ parameter in settings.inc.php file
Your PrestaShop is installed in web server root directory or sub directory. If you moved your shop to other directory then __PS_BASE_URI__ is incorrect and you will not be able to log in to your back office anymore. Or you could change this parameter accidentally.
Find file /config/settings.inc.php. Open it with text editor and check __PS_BASE_URI__ parameter. If your PrestaShop is located in a sub directory then it should look like this:
define('__PS_BASE_URI__', '/your_sub_directory_name/');
If it is in web server root directory then it should look like this:
define('__PS_BASE_URI__', '/');
It helped to me but if you still cannot access your admin admin then go to next stepl
5. Hack your PrestaShop (you’ll need FTP access)
It’s not actually a hacking because you’ll need access to your PrestaShop php files but it will allow you to access PreStashop back office with correct email and any at least 5 symbols random password – PrestaShop checks password length before authentication.
This method is unsecure because anybody will be able to login with correct email and any long enough password.
OK find the file: your_admin_folder/login.php.
Find line:
$employee = $employee->getByemail($email, $passwd);
Change it to:
$employee = $employee->getByemail($email, null);
Now try to login with correct email and at least 5 symbols random password. It worked for me – tested with PrestaShop 1.4.2.5 and 1.4.3.0
As I mentioned before this method is not actually hacking but it may be used for malicious purposes also
Updated 2011.07.02:
Well there is one more reason that can cause this problem – PHP bug: https://bugs.php.net/bug.php?id=42523
This problem was also reported to PrestaShop: http://forge.prestashop.com/browse/PSCFI-1110
If your PHP installation has this bug then $_SERVER['PHP_SELF'] variable will return the wrong value which is used in cookie path calculation.You can find this line in your admin folder/login.php file (54 line i PrestaShop 1.4.3.0):
$cookie = new Cookie('psAdmin', substr($_SERVER['PHP_SELF'], strlen(__PS_BASE_URI__), -10));
Change this line to:
$cookie = new Cookie('psAdmin', substr($_SERVER['SCRIPT_NAME'], strlen(__PS_BASE_URI__), -10));
It resolved the problem for me.
Hope you liked this post. Feel free to comment or suggest ideas for new articles














