How to reset OpenCart 2+ admin password?

Obviously, the new (v2) OpenCart password encryption scheme is not a simple md5 hash. I tried to find the path to reset the administrator password on the network after I changed the hosts for installing OpenCart, but could not find anything.

Thank.

+6
source share
5 answers

If you just need to regain access and change your password, you can do this quite easily. Open system/library/user.php( system/library/cart/user.phpin later versions) and find the beginning of the line

$user_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "user WHERE username = 

Before WHEREsetting a #, changing it to

$user_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "user #WHERE username = 

. , ( ) - . , . - , , .

+10

, MySQL phpMyAdmin MySQL

password - oc_user phpMyAdmin, - password MySQL. Salt & Hashing MySQL . :

oc_user password & salt user_id

: d1c194daffb03fc2653027c87f76a12a4eaeac5f

: x3x6r693j

/ " password " ( ) . , , .

"". . OpenCart Admin (www.yourwebsitename.com/admin) .

: < >

:

user_id, :

update 'oc_user' set 'password' = sha1( concat('salt', sha1( concat('salt', sha1('password'))))) where user_id = 1


Explaination:

sha1($salt . sha1($salt . sha1($password)))

admin/model/user/user.php

SELECT SHA1( CONCAT( salt, SHA1( CONCAT( salt, SHA1(  'password' ) ) ) ) ) 
FROM oc_user
WHERE user_id =1
LIMIT 0 , 30

: d1c194daffb03fc2653027c87f76a12a4eaeac5f

:

$salt = substr(md5(uniqid(rand(), true)), 0, 9)

uniqid(), password_hash password_verify PHP-. MySQL

password_hash MD5 . md5 password_hash()


Tool: OpenCart 2. 0+ ,

+4

OpenCart ( admin/model/user/user.php)

sha1($salt . sha1($salt . sha1($data['password'])))

, ,

SELECT salt FROM your_db.oc_user WHERE username='your_username';

, . bash ($ SALT ):

echo -n $SALT$(echo -n $SALT$(echo -n "newpassword" | sha1sum|cut -d' ' -f1 )|sha1sum|cut -d' ' -f1)|sha1sum

, :

UPDATAE your_db.oc_user SET password='newhash' WHERE username='your_username';

.

+1

mysql.

UPDATE oc_user SET password = MD5('nanhe') WHERE user_id = 1;
0

0ZReKeFZM75Y database > oc_user

0c7a864c5a737f08f001f3123849ba5e03af3d06

HYSQS59P9

.

0

All Articles