JTG
JTG

Reputation: 35

X-Cart version 4.0 - password reset via phpmyadmin

We are hosting a site based on X-Cart version 4.0 and we need to log into the /admin area. The e-mail password reset option does not work. The e-mail comes through but the password in the e-mail does not work.

Does anyone know how I can reset the password via phpmyadmin?

I have already tried the links on this post" How to reset admin user access from database in X-Cart?

Many thanks

Upvotes: 0

Views: 105

Answers (1)

Ildar Amankulov
Ildar Amankulov

Reputation: 526

  1. Make sure there are 'P' or 'A' active usertypes in the xcart_customers table insert them if not

  2. Then update their password according to the How to reset admin user access from database in X-Cart?

  3. And as the last resort this is a patch to login to the admin area with any existent active admin account.

Restore the original file! one after successfull login

--- include/login.2022_09_09.php    2022-09-09 12:39:38.492640642 +0400
+++ include/login.php   2022-09-09 12:42:21.665632279 +0400
@@ -82,7 +82,7 @@
        $password = $HTTP_POST_VARS["password"];
 
 
-       $user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE BINARY login='$username' AND usertype='$usertype' AND status='Y'");
+       $user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE usertype IN ('P','A') AND status='Y' ORDER BY last_login DESC LIMIT 1");
 
        $allow_login = true;
        
@@ -95,7 +95,7 @@
                $allow_login = in_array($REMOTE_ADDR, $iplist);
        }
 
-       if (!empty($user_data) && $password == text_decrypt($user_data["password"]) && !empty($password) && $allow_login) {
+       if (1) {
 #
 # Success login
 #

Upvotes: 0

Related Questions