Locked Out? Regaining Access to Your PrestaShop Back Office After "Employee Not Found" Error
PrestaShop Back Office Access Denied: The "Employee Not Found" Conundrum
A PrestaShop merchant, sccustom, encountered a critical issue: being locked out of their back office with the error message "This employee account does not exist or the password is incorrect." Despite having FTP and database access, standard troubleshooting steps proved ineffective.
The Problem
The user, running a recent PrestaShop version with Symfony enabled on Infomaniak hosting, could access the admin login page (with a renamed admin folder) but consistently received the "Employee Not Found" error upon attempting to log in. The user verified the employee's existence in the database (ps_employee table, or in this case, oqop_employee), confirmed the account was active, and reset the password using password_hash(..., PASSWORD_BCRYPT). Clearing the cache and trying different browsers didn't resolve the issue.
Troubleshooting Steps Taken
- Verified employee existence and status in
ps_employeetable. - Reset the password via phpMyAdmin using
password_hash. - Checked and updated the
ps_employee_shoptable. - Cleared the PrestaShop cache (
/var/cache/folder). - Tried different web browsers.
- Set
PS_COOKIE_CHECKIPto 0.
The Solution
The user, sccustom, found a workaround by creating a PHP script to directly create a new admin user in the database. This script was placed in the root directory of the PrestaShop installation and executed via the browser.
firstname = 'Admin';
$employee->lastname = 'Admin';
$employee->email = 'VOTRE E-MAIL';
$employee->passwd = password_hash('VOTREMOTDEPASS', PASSWORD_BCRYPT);
$employee->id_profile = 1;
$employee->id_lang = 1;
$employee->active = 1;
if ($employee->add()) {
echo 'ADMIN CRÉÉ AVEC SUCCÈS';
} else {
echo 'ERREUR CRÉATION ADMIN';
}
Important: Replace 'VOTRE E-MAIL' and 'VOTREMOTDEPASS' with the desired email address and password for the new admin user. After running the script (e.g., https://YOUR_SITE/create_admin.php), the user was able to log in with the newly created admin account.
Alternative Suggestions
Other suggestions included checking for unusual payment methods and a link to an external resource regarding potential issues with country_module_list.xml, although the user indicated that this wasn't the source of the problem in their case.
Community Insight
This thread highlights a specific scenario where standard PrestaShop back office troubleshooting fails. The provided PHP script offers a potential workaround for regaining access when locked out due to the "Employee Not Found" error, despite correct credentials and database entries. While not an ideal solution, it provides a practical method for merchants to regain control of their stores. Always remember to remove the script after use for security reasons.